From 92e99626bb4cb15ecd336a1e1ddb97d0305b5e1d Mon Sep 17 00:00:00 2001 From: markzd Date: Wed, 12 Dec 2012 22:26:23 +0000 Subject: - Fixed a glitch which was causing some buffs to have more duration than intended.(bugreport:6606) - Fixed a glitch, related to r16109, which caused some buffs to end prematurely. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17020 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/skill.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/map/skill.c b/src/map/skill.c index f61c6e480..bf7bee83a 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -11141,11 +11141,9 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un case UNT_DONTFORGETME: case UNT_FORTUNEKISS: case UNT_SERVICEFORYOU: - if (sg->src_id==bl->id && !(sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_BARDDANCER)) { - if( sce )/* We have the status but we're not elegible for it, so we take it away. (bugreport:4591) */ - sce->val4 = 2; + if (sg->src_id==bl->id && !(sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_BARDDANCER)) return 0; - } + if (!sc) return 0; if (!sce) sc_start4(bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit); @@ -12060,17 +12058,13 @@ static int skill_unit_onleft (int skill_id, struct block_list *bl, unsigned int case DC_DONTFORGETME: case DC_FORTUNEKISS: case DC_SERVICEFORYOU: - if (sce) { - if( sce->val4 == 2 ) {/* We have the status but we're not elegible for it, so we take it away. (bugreport:4591) */ - if( !( sc && sc->data[SC_DANCING] && sc->data[SC_DANCING]->val2 ) )/* check if we're still in the skill */ - status_change_end(bl,type,INVALID_TIMER); - } else { - delete_timer(sce->timer, status_change_timer); - //NOTE: It'd be nice if we could get the skill_lv for a more accurate extra time, but alas... - //not possible on our current implementation. - sce->val4 = 1; //Store the fact that this is a "reduced" duration effect. - sce->timer = add_timer(tick+skill_get_time2(skill_id,1), status_change_timer, bl->id, type); - } + if (sce) + { + delete_timer(sce->timer, status_change_timer); + //NOTE: It'd be nice if we could get the skill_lv for a more accurate extra time, but alas... + //not possible on our current implementation. + sce->val4 = 1; //Store the fact that this is a "reduced" duration effect. + sce->timer = add_timer(tick+skill_get_time2(skill_id,1), status_change_timer, bl->id, type); } break; case PF_FOGWALL: @@ -12124,16 +12118,10 @@ static int skill_unit_effect (struct block_list* bl, va_list ap) //Necessary in case the group is deleted after calling on_place/on_out [Skotlex] skill_id = group->skill_id; - //Target-type check. - if( !(group->bl_flag&bl->type && battle_check_target(&unit->bl,bl,group->target_flag)>0) ) { - if( flag&4 && group->src_id == bl->id && group->state.song_dance&0x2 ) { + if( !(group->bl_flag&bl->type && battle_check_target(&unit->bl,bl,group->target_flag)>0) && (flag&4) ) { + if( group->state.song_dance&0x1 || (group->src_id == bl->id && group->state.song_dance&0x2) ) skill_unit_onleft(skill_id, bl, tick);//Ensemble check to terminate it. - } else { - if ( flag&4 && skill_get_inf2(skill_id)&INF2_SONG_DANCE) { // Make a exception for song/dance skill - skill_unit_onleft(unit->val1, bl, tick); //TODO: fix skill_dance_switch - } - } } else { if( flag&1 ) skill_unit_onplace(unit,bl,tick); -- cgit v1.2.3-60-g2f50