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/map/mob.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/map/mob.c')
-rw-r--r-- | src/map/mob.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 73d752702..e1c324ba1 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -548,11 +548,8 @@ static int mob_spawn_guardian_sub(int tid, unsigned int tick, int id, intptr_t d guild_castledatasave(md->guardian_data->castle->castle_id, 1, 0); } } else { - if( md->guardian_data->number >= 0 && md->guardian_data->number < MAX_GUARDIANS && md->guardian_data->castle->guardian[md->guardian_data->number].visible ) - { //Safe removal of guardian. - md->guardian_data->castle->guardian[md->guardian_data->number].visible = 0; + if (md->guardian_data->number >= 0 && md->guardian_data->number < MAX_GUARDIANS && md->guardian_data->castle->guardian[md->guardian_data->number].visible) guild_castledatasave(md->guardian_data->castle->castle_id, 10+md->guardian_data->number,0); - } unit_free(&md->bl,CLR_OUTSIGHT); //Remove guardian. } return 0; @@ -2512,13 +2509,10 @@ void mob_revive(struct mob_data *md, unsigned int hp) clif_charnameack (0, &md->bl); } -int mob_guardian_guildchange(struct block_list *bl,va_list ap) +int mob_guardian_guildchange(struct mob_data *md) { - struct mob_data *md; - struct guild* g; - - nullpo_ret(bl); - nullpo_ret(md = (struct mob_data *)bl); + struct guild *g; + nullpo_ret(md); if (!md->guardian_data) return 0; @@ -2531,11 +2525,8 @@ int mob_guardian_guildchange(struct block_list *bl,va_list ap) md->guardian_data->emblem_id = 0; md->guardian_data->guild_name[0] = '\0'; } else { - if( md->guardian_data->number >= 0 && md->guardian_data->number < MAX_GUARDIANS && md->guardian_data->castle->guardian[md->guardian_data->number].visible ) - { //Safe removal of guardian. - md->guardian_data->castle->guardian[md->guardian_data->number].visible = 0; - guild_castledatasave(md->guardian_data->castle->castle_id, 10+md->guardian_data->number,0); - } + if (md->guardian_data->number >= 0 && md->guardian_data->number < MAX_GUARDIANS && md->guardian_data->castle->guardian[md->guardian_data->number].visible) + guild_castledatasave(md->guardian_data->castle->castle_id, 10+md->guardian_data->number, 0); unit_free(&md->bl,CLR_OUTSIGHT); //Remove guardian. } return 0; @@ -2545,11 +2536,8 @@ int mob_guardian_guildchange(struct block_list *bl,va_list ap) if (g == NULL) { //Properly remove guardian info from Castle data. ShowError("mob_guardian_guildchange: New Guild (id %d) does not exists!\n", md->guardian_data->guild_id); - if( md->guardian_data->number >= 0 && md->guardian_data->number < MAX_GUARDIANS ) - { - md->guardian_data->castle->guardian[md->guardian_data->number].visible = 0; - guild_castledatasave(md->guardian_data->castle->castle_id, 10+md->guardian_data->number,0); - } + if (md->guardian_data->number >= 0 && md->guardian_data->number < MAX_GUARDIANS) + guild_castledatasave(md->guardian_data->castle->castle_id, 10+md->guardian_data->number, 0); unit_free(&md->bl,CLR_OUTSIGHT); return 0; } |