summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-24 14:16:54 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-24 14:16:54 +0000
commitaf0c947f3ce68479a1d41612ace459e74dead363 (patch)
tree62cc27a382ce95d44d72ef178461ddc38df88b50 /src/map/unit.c
parent3f23418f9e30c10345f1e898bb4117d4d7dcf814 (diff)
downloadhercules-af0c947f3ce68479a1d41612ace459e74dead363.tar.gz
hercules-af0c947f3ce68479a1d41612ace459e74dead363.tar.bz2
hercules-af0c947f3ce68479a1d41612ace459e74dead363.tar.xz
hercules-af0c947f3ce68479a1d41612ace459e74dead363.zip
- Some small, insignificant code cleanups in unit.c
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5730 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 1b451e2fe..f41796d26 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1546,34 +1546,32 @@ int unit_free(struct block_list *bl) {
if( bl->type == BL_PC ) {
struct map_session_data *sd = (struct map_session_data*)bl;
-
- if(status_isdead(&sd->bl))
+ if(status_isdead(bl))
pc_setrestartvalue(sd,2);
//Status that are not saved...
if(sd->sc.count) {
if(sd->sc.data[SC_SPURT].timer!=-1)
- status_change_end(&sd->bl,SC_SPURT,-1);
+ status_change_end(bl,SC_SPURT,-1);
if(sd->sc.data[SC_BERSERK].timer!=-1)
- status_change_end(&sd->bl,SC_BERSERK,-1);
+ status_change_end(bl,SC_BERSERK,-1);
if(sd->sc.data[SC_TRICKDEAD].timer!=-1)
- status_change_end(&sd->bl,SC_TRICKDEAD,-1);
+ status_change_end(bl,SC_TRICKDEAD,-1);
if (battle_config.debuff_on_logout) {
if(sd->sc.data[SC_STRIPWEAPON].timer!=-1)
- status_change_end(&sd->bl,SC_STRIPWEAPON,-1);
+ status_change_end(bl,SC_STRIPWEAPON,-1);
if(sd->sc.data[SC_STRIPARMOR].timer!=-1)
- status_change_end(&sd->bl,SC_STRIPARMOR,-1);
+ status_change_end(bl,SC_STRIPARMOR,-1);
if(sd->sc.data[SC_STRIPSHIELD].timer!=-1)
- status_change_end(&sd->bl,SC_STRIPSHIELD,-1);
+ status_change_end(bl,SC_STRIPSHIELD,-1);
if(sd->sc.data[SC_STRIPHELM].timer!=-1)
- status_change_end(&sd->bl,SC_STRIPHELM,-1);
+ status_change_end(bl,SC_STRIPHELM,-1);
if(sd->sc.data[SC_EXTREMITYFIST].timer!=-1)
- status_change_end(&sd->bl,SC_EXTREMITYFIST,-1);
+ status_change_end(bl,SC_EXTREMITYFIST,-1);
if(sd->sc.data[SC_EXPLOSIONSPIRITS].timer!=-1)
- status_change_end(&sd->bl,SC_EXPLOSIONSPIRITS,-1);
+ status_change_end(bl,SC_EXPLOSIONSPIRITS,-1);
}
}
-
// Notify friends that this char logged out. [Skotlex]
clif_foreachclient(clif_friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 0);
party_send_logout(sd);
@@ -1631,15 +1629,12 @@ int unit_free(struct block_list *bl) {
aFree(pd->status);
pd->status = NULL;
}
- map_deliddb(&pd->bl);
- map_freeblock(&pd->bl);
if (sd) sd->pd = NULL;
} else if(bl->type == BL_MOB) {
struct mob_data *md = (struct mob_data*)bl;
if(md->deletetimer!=-1)
delete_timer(md->deletetimer,mob_timer_delete);
md->deletetimer=-1;
- map_deliddb(&md->bl);
if(md->lootitem) {
aFree(md->lootitem);
md->lootitem=NULL;
@@ -1659,9 +1654,13 @@ int unit_free(struct block_list *bl) {
}
if(mob_is_clone(md->class_))
mob_clone_delete(md->class_);
- map_freeblock(bl);
}
status_change_clear(bl,1);
+ if (bl->type != BL_PC)
+ { //Players are handled by map_quit
+ map_deliddb(bl);
+ map_freeblock(bl);
+ }
map_freeblock_unlock();
return 0;
}