From 54a7f124543239c98d696da37c91eb5e2e99b25d Mon Sep 17 00:00:00 2001 From: skotlex Date: Fri, 20 Oct 2006 18:30:05 +0000 Subject: - Fixed Charge Atk being able to go through chasm/pits. - Moved the homunculus DB information from the player structure to the homun structure. Modified the homunculus creation packets to hold this information during creation, also, all initial values are handled by the map-server, the char server only assigns it a homun ID. - Removed target_id/attacked_id from homun_data as it wasn't really used. - Codes cleanup (removing of commented code mostly) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9031 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/unit.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/map/unit.c') diff --git a/src/map/unit.c b/src/map/unit.c index b7f42447e..38589b8e0 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -666,6 +666,9 @@ int unit_can_move(struct block_list *bl) if (DIFF_TICK(ud->canmove_tick, gettick()) > 0) return 0; + if (status_isdead(bl)) + return 0; + if (sd && ( pc_issit(sd) || sd->state.blockedmove @@ -1633,7 +1636,7 @@ 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 || !sd->homunculus.intimacy) + if(!sd || !hd->homunculus.intimacy) { //He's going to be deleted. clif_emotion(bl, 28) ; //sob clif_clearchar_area(bl,clrtype); @@ -1818,17 +1821,14 @@ int unit_free(struct block_list *bl, int clrtype) { struct map_session_data *sd = hd->master; // Desactive timers merc_hom_hungry_timer_delete(hd); - if(sd) { - if (sd->homunculus.intimacy > 0) - merc_save(hd); - else - { - intif_homunculus_requestdelete(sd->homunculus.hom_id) ; - sd->status.hom_id = 0; - sd->homunculus.hom_id = 0; - } - sd->hd = NULL; + if (hd->homunculus.intimacy > 0) + merc_save(hd); + else + { + intif_homunculus_requestdelete(hd->homunculus.hom_id); + if (sd) sd->status.hom_id = 0; } + if(sd) sd->hd = NULL; } skill_clear_unitgroup(bl); -- cgit v1.2.3-70-g09d2