diff options
author | shennetsind <ind@henn.et> | 2015-02-13 11:21:44 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2015-02-13 11:21:44 -0200 |
commit | 868a2b4ab50431e0d0a48927b40156d5a83d9d46 (patch) | |
tree | 76d555000b29adc5276b377390bfd4dbf7cf8031 /src/map | |
parent | 00ca143b9f76620b7f68559bbdb4458e6936b639 (diff) | |
download | hercules-868a2b4ab50431e0d0a48927b40156d5a83d9d46.tar.gz hercules-868a2b4ab50431e0d0a48927b40156d5a83d9d46.tar.bz2 hercules-868a2b4ab50431e0d0a48927b40156d5a83d9d46.tar.xz hercules-868a2b4ab50431e0d0a48927b40156d5a83d9d46.zip |
Fixed alchemist marine sphere causing double deletion on renewal
Special Thanks to Haruna, Michieru.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 6 | ||||
-rw-r--r-- | src/map/mob.c | 10 | ||||
-rw-r--r-- | src/map/status.c | 26 |
3 files changed, 21 insertions, 21 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 37e13a83f..7b979a51f 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -263,7 +263,7 @@ int battle_delay_damage(int64 tick, int amotion, struct block_list *src, struct if (d_tbl && sc && check_distance_bl(target, d_tbl, sc->data[SC_DEVOTION]->val3) && damage > 0 && skill_id != PA_PRESSURE && skill_id != CR_REFLECTSHIELD) damage = 0; - + if ( !battle_config.delay_battle_damage || amotion <= 1 ) { map->freeblock_lock(); status_fix_damage(src, target, damage, ddelay); // We have to separate here between reflect damage and others [icescope] @@ -3160,9 +3160,9 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam } if( bl->type == BL_MOB && !status->isdead(bl) && src != bl) { - if (damage > 0 ) + if ( damage > 0 ) mob->skill_event((TBL_MOB*)bl,src,timer->gettick(),flag); - if (skill_id) + if (skill_id) mob->skill_event((TBL_MOB*)bl,src,timer->gettick(),MSC_SKILLUSED|(skill_id<<16)); } if( sd ) { diff --git a/src/map/mob.c b/src/map/mob.c index d8898619c..a94650438 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2074,11 +2074,6 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage) { } } #endif - - if( md->special_state.ai == 2 ) {//LOne WOlf explained that ANYONE can trigger the marine countdown skill. [Skotlex] - md->state.alchemist = 1; - mob->skill_use(md, timer->gettick(), MSC_ALCHEMIST); - } } /*========================================== @@ -3307,6 +3302,11 @@ int mobskill_event(struct mob_data *md, struct block_list *src, int64 tick, int if(md->bl.prev == NULL || md->status.hp <= 0) return 0; + if( md->special_state.ai == 2 ) {//LOne WOlf explained that ANYONE can trigger the marine countdown skill. [Skotlex] + md->state.alchemist = 1; + return mob->skill_use(md, timer->gettick(), MSC_ALCHEMIST); + } + target_id = md->target_id; if (!target_id || battle_config.mob_changetarget_byskill) md->target_id = src->id; diff --git a/src/map/status.c b/src/map/status.c index 296bbe1f3..2595e8cf1 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1258,11 +1258,11 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, } switch (target->type) { - case BL_PC: pc->damage((TBL_PC*)target,src,hp,sp); break; - case BL_MOB: mob->damage((TBL_MOB*)target, src, hp); break; - case BL_HOM: homun->damaged((TBL_HOM*)target); break; - case BL_MER: mercenary->heal((TBL_MER*)target,hp,sp); break; - case BL_ELEM: elemental->heal((TBL_ELEM*)target,hp,sp); break; + case BL_PC: pc->damage((TBL_PC*)target,src,hp,sp); break; + case BL_MOB: mob->damage((TBL_MOB*)target, src, hp); break; + case BL_HOM: homun->damaged((TBL_HOM*)target); break; + case BL_MER: mercenary->heal((TBL_MER*)target,hp,sp); break; + case BL_ELEM: elemental->heal((TBL_ELEM*)target,hp,sp); break; } if( src && target->type == BL_PC && (((TBL_PC*)target)->disguise) > 0 ) {// stop walking when attacked in disguise to prevent walk-delay bug @@ -1283,14 +1283,14 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, //&2: Also remove object from map. //&4: Also delete object from memory. switch (target->type) { - case BL_PC: flag = pc->dead((TBL_PC*)target,src); break; - case BL_MOB: flag = mob->dead((TBL_MOB*)target, src, (flag&4) ? 3 : 0); break; - case BL_HOM: flag = homun->dead((TBL_HOM*)target); break; - case BL_MER: flag = mercenary->dead((TBL_MER*)target); break; - case BL_ELEM: flag = elemental->dead((TBL_ELEM*)target); break; - default: //Unhandled case, do nothing to object. - flag = 0; - break; + case BL_PC: flag = pc->dead((TBL_PC*)target,src); break; + case BL_MOB: flag = mob->dead((TBL_MOB*)target, src, (flag&4) ? 3 : 0); break; + case BL_HOM: flag = homun->dead((TBL_HOM*)target); break; + case BL_MER: flag = mercenary->dead((TBL_MER*)target); break; + case BL_ELEM: flag = elemental->dead((TBL_ELEM*)target); break; + default: //Unhandled case, do nothing to object. + flag = 0; + break; } if(!flag) //Death canceled. |