From d22ee8c44edd2ae3574cc818536ef096e9413b98 Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 22 Nov 2006 00:18:41 +0000 Subject: - Fixed pets/homunc trying to be deleted twice when they had 0 intimacy and their master logs out. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9290 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/unit.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/map/unit.c') diff --git a/src/map/unit.c b/src/map/unit.c index 81aa1c3b9..6e3c66288 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1643,7 +1643,9 @@ int unit_remove_map(struct block_list *bl, int clrtype) { md->state.skillstate= MSS_IDLE; } else if (bl->type == BL_PET) { struct pet_data *pd = (struct pet_data*)bl; - if(pd->pet.intimate <= 0) { + if(pd->pet.intimate <= 0 && + !(pd->msd && pd->msd->state.waitingdisconnect) + ) { //If logging out, this is deleted on unit_free clif_clearchar_area(bl,clrtype); map_delblock(bl); unit_free(bl,0); @@ -1652,9 +1654,9 @@ int unit_remove_map(struct block_list *bl, int clrtype) { } } else if (bl->type == BL_HOM) { struct homun_data *hd = (struct homun_data *) bl; - struct map_session_data *sd = hd->master; - if(!sd || !hd->homunculus.intimacy) - { //He's going to be deleted. + if(!hd->homunculus.intimacy && + !(hd->master && hd->master->state.waitingdisconnect) + ) { //If logging out, this is deleted on unit_free clif_emotion(bl, 28) ; //sob clif_clearchar_area(bl,clrtype); map_delblock(bl); -- cgit v1.2.3-60-g2f50