diff options
author | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-05 00:08:28 +0000 |
---|---|---|
committer | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-05 00:08:28 +0000 |
commit | a6325af8d937fbf600362bacde389e6fa7d02719 (patch) | |
tree | e6d526f4dd8ca73b757751039be5cfa388a994da /src/char/int_guild.c | |
parent | 262e60ab0b9cfc1f942a7b3ef11f7ed3abc7b208 (diff) | |
download | hercules-a6325af8d937fbf600362bacde389e6fa7d02719.tar.gz hercules-a6325af8d937fbf600362bacde389e6fa7d02719.tar.bz2 hercules-a6325af8d937fbf600362bacde389e6fa7d02719.tar.xz hercules-a6325af8d937fbf600362bacde389e6fa7d02719.zip |
- Guild Castle code cleanup:
- all changes to guild castle data are now handled first by map-server and only sent to char-server for saving
- ensured that changes made to guild castle during char-server disconnection time will be resent on reconnect
- actually removed definition of `MAX_GUILDCASTLE` (r15657)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15658 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/int_guild.c')
-rw-r--r-- | src/char/int_guild.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 912ee8ab1..d0f41b541 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -1136,17 +1136,6 @@ int mapif_guild_castle_dataload(int fd, int sz, int *castle_ids) return 0; } -int mapif_guild_castle_datasave(int fd, int castle_id, int index, int value) -{ - WFIFOHEAD(fd, 9); - WFIFOW(fd, 0) = 0x3841; - WFIFOW(fd, 2) = castle_id; - WFIFOB(fd, 4) = index; - WFIFOL(fd, 5) = value; - WFIFOSET(fd, 9); - return 0; -} - //------------------------------------------------------------------- // Packet received from map server @@ -1776,24 +1765,18 @@ int mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int value) if (gc == NULL) { ShowError("mapif_parse_GuildCastleDataSave: castle id=%d not found\n", castle_id); - mapif_guild_castle_datasave(fd, castle_id, index, value); return 0; } switch (index) { case 1: - if (gc->guild_id != value) { + if (log_inter && gc->guild_id != value) { int gid = (value) ? value : gc->guild_id; struct guild *g = idb_get(guild_db_, gid); - if (log_inter) - inter_log("guild %s (id=%d) %s castle id=%d\n", - (g) ? g->name : "??", gid, (value) ? "occupy" : "abandon", castle_id); + inter_log("guild %s (id=%d) %s castle id=%d\n", + (g) ? g->name : "??", gid, (value) ? "occupy" : "abandon", castle_id); } gc->guild_id = value; - if (gc->guild_id == 0) { - // Delete guardians. - memset(gc->guardian, 0, sizeof(gc->guardian)); - } break; case 2: gc->economy = value; break; case 3: gc->defense = value; break; @@ -1812,7 +1795,6 @@ int mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int value) return 0; } inter_guildcastle_tosql(gc); - mapif_guild_castle_datasave(fd, gc->castle_id, index, value); return 0; } |