summaryrefslogtreecommitdiff
path: root/src/char_sql/int_guild.c
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-27 14:13:55 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-27 14:13:55 +0000
commit3f3e2fff4f536501846daed169fcf6c9f8dbf4ef (patch)
tree5148b8a08b17cb67fd43c1c9a6ff8273e04a8ae5 /src/char_sql/int_guild.c
parentbd17820a383dea794a53795b75a49667920e00f6 (diff)
downloadhercules-3f3e2fff4f536501846daed169fcf6c9f8dbf4ef.tar.gz
hercules-3f3e2fff4f536501846daed169fcf6c9f8dbf4ef.tar.bz2
hercules-3f3e2fff4f536501846daed169fcf6c9f8dbf4ef.tar.xz
hercules-3f3e2fff4f536501846daed169fcf6c9f8dbf4ef.zip
foo
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@818 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/int_guild.c')
-rw-r--r--src/char_sql/int_guild.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c
index 8613ca504..ffb7e758e 100644
--- a/src/char_sql/int_guild.c
+++ b/src/char_sql/int_guild.c
@@ -41,7 +41,7 @@ int guild_break_sub(void *key,void *data,va_list ap);
#define mysql_query(_x, _y) debug_mysql_query(__FILE__, __LINE__, _x, _y)
-int _erase_guild(void *key, void *data, va_list ap) {
+static int _erase_guild(void *key, void *data, va_list ap) {
int guild = va_arg(ap, int);
struct guild_castle * castle = (struct guild_castle *) data;
if (castle->guild_id == guild) {
@@ -504,6 +504,18 @@ struct guild * inter_guild_fromsql(int guild_id)
return g;
}
+static int _set_guild_castle(void *key, void *data, va_list ap) {
+ int castle_id = va_arg(ap, int);
+ int guild_id = va_arg(ap, int);
+ struct guild * g = (struct guild *) data;
+
+ if (g->castle_id == castle_id)
+ g->castle_id = -1;
+ if (g->guild_id == guild_id)
+ g->castle_id = castle_id;
+}
+
+
// Save guild_castle to sql
int inter_guildcastle_tosql(struct guild_castle *gc)
{
@@ -551,6 +563,8 @@ int inter_guildcastle_tosql(struct guild_castle *gc)
printf("DB server Error - %s\n", mysql_error(&mysql_handle) );
return 0;
}
+
+ db_foreach(guild_db_, _set_guild_castle, gc->castle_id,gc->guild_id);
return 0;
}
@@ -1231,7 +1245,7 @@ int mapif_parse_GuildLeave(int fd,int guild_id,int account_id,int char_id,int fl
mapif_guild_info(-1,g);// まだ人がいるのでデータ送信
/*
else
- inter_guild_save(); // 解散したので一応セーブ
+ inter_guild_save(); // 解散したので一営Zーブ
return 0;*/
}
}