From 064dad8c094d9c694a73a0110189932c9ab4f257 Mon Sep 17 00:00:00 2001 From: malufett Date: Thu, 21 Feb 2013 21:27:35 +0800 Subject: Fixed Bug #7066 and Follow up Bug #4832 -Where KG and OB can hit there Zanzoe. -Ankle Snare should now work properly in GvG. Signed-off-by: malufett --- src/map/battle.c | 2 +- src/map/status.c | 1 + src/map/unit.c | 6 ------ 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/map/battle.c b/src/map/battle.c index 3140fbc18..924c9d8a5 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5195,7 +5195,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f case BL_MOB: if(((((TBL_MOB*)target)->special_state.ai == 2 || //Marine Spheres (((TBL_MOB*)target)->special_state.ai == 3 && battle_config.summon_flora&1)) && //Floras - s_bl->type == BL_PC && src->type != BL_MOB) || ((TBL_MOB*)target)->special_state.ai == 4) //Zanzoe + s_bl->type == BL_PC && src->type != BL_MOB) || ((TBL_MOB*)target)->special_state.ai == 4 && t_bl->id != src->id) //Zanzoe { //Targettable by players state |= BCT_ENEMY; strip_enemy = 0; diff --git a/src/map/status.c b/src/map/status.c index edac88af0..d61503a0e 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -998,6 +998,7 @@ void initChangeTables(void) { StatusIconChangeTable[SC_HALLUCINATION] = SI_BLANK; /* StatusChangeState (SCS_) NOMOVE */ + StatusChangeStateTable[SC_ANKLE] |= SCS_NOMOVE; StatusChangeStateTable[SC_AUTOCOUNTER] |= SCS_NOMOVE; StatusChangeStateTable[SC_TRICKDEAD] |= SCS_NOMOVE; StatusChangeStateTable[SC_BLADESTOP] |= SCS_NOMOVE; diff --git a/src/map/unit.c b/src/map/unit.c index 4ca64d7f8..388c3757d 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -353,8 +353,6 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag) map_random_dir(bl, &ud->to_x, &ud->to_y); if(ud->walktimer != INVALID_TIMER) { - if( !battle_config.skill_trap_type && sc && map_flag_gvg(bl->m) && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path - return 0; // When you come to the center of the grid because the change of destination while you're walking right now // Call a function from a timer unit_walktoxy_sub ud->state.change_walk_target = 1; @@ -430,8 +428,6 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int map_random_dir(bl, &ud->to_x, &ud->to_y); if(ud->walktimer != INVALID_TIMER) { - if( !battle_config.skill_trap_type && sc && map_flag_gvg(bl->m) && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path - return 0; ud->state.change_walk_target = 1; set_mobstate(bl, flag&2); return 1; @@ -938,8 +934,6 @@ int unit_can_move(struct block_list *bl) { ) return 0; - if( sc->data[SC_ANKLE] && ( battle_config.skill_trap_type || ( !map_flag_gvg(bl->m) && !unit_is_walking(bl) ) ) ) // Ankle only stops you after you're done moving - return 0; if (sc->opt1 > 0 && sc->opt1 != OPT1_STONEWAIT && sc->opt1 != OPT1_BURNING && !(sc->opt1 == OPT1_CRYSTALIZE && bl->type == BL_MOB)) return 0; -- cgit v1.2.3-60-g2f50 From 84926b94e869a19f08a7a25df15b4c677316cd32 Mon Sep 17 00:00:00 2001 From: malufett Date: Fri, 22 Feb 2013 02:12:01 +0800 Subject: Fixed Bug #6708 -Where leveling homunculus causes map server to crash due to infinite loop. Signed-off-by: malufett --- src/map/atcommand.c | 11 +++++++---- src/map/homunculus.c | 13 ++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 0d56ce9bf..dbf66b6aa 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6884,7 +6884,7 @@ ACMD_FUNC(showmobs) ACMD_FUNC(homlevel) { TBL_HOM * hd; - int level = 0, i = 0; + int level = 0; nullpo_retr(-1, sd); @@ -6900,10 +6900,13 @@ ACMD_FUNC(homlevel) hd = sd->hd; - for (i = 1; i <= level && hd->exp_next; i++){ + if ( battle_config.hom_max_level == hd->homunculus.level ) // Already reach maximum level + return 0; + + do{ hd->homunculus.exp += hd->exp_next; - merc_hom_levelup(hd); - } + }while( hd->homunculus.level < level && merc_hom_levelup(hd) ); + status_calc_homunculus(hd,0); status_percent_heal(&hd->bl, 100, 100); clif_specialeffect(&hd->bl,568,AREA); diff --git a/src/map/homunculus.c b/src/map/homunculus.c index 9a0a1c898..4dc30934d 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -503,11 +503,7 @@ int merc_hom_gainexp(struct homun_data *hd,int exp) } //levelup - do - { - merc_hom_levelup(hd) ; - } - while(hd->homunculus.exp > hd->exp_next && hd->exp_next != 0 ); + while( hd->homunculus.exp > hd->exp_next && merc_hom_levelup(hd) ); if( hd->exp_next == 0 ) hd->homunculus.exp = 0 ; @@ -983,7 +979,7 @@ void merc_reset_stats(struct homun_data *hd) int merc_hom_shuffle(struct homun_data *hd) { struct map_session_data *sd; - int lv, i, skillpts; + int lv, skillpts; unsigned int exp; struct s_skill b_skill[MAX_HOMUNSKILL]; @@ -998,10 +994,9 @@ int merc_hom_shuffle(struct homun_data *hd) //Reset values to level 1. merc_reset_stats(hd); //Level it back up - for (i = 1; i < lv && hd->exp_next; i++){ + do{ hd->homunculus.exp += hd->exp_next; - merc_hom_levelup(hd); - } + }while( hd->homunculus.level < lv && merc_hom_levelup(hd) ); if(hd->homunculus.class_ == hd->homunculusDB->evo_class) { //Evolved bonuses -- cgit v1.2.3-60-g2f50