summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-15 14:00:27 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-15 14:00:27 +0000
commit00be89f64050ff5373a63cc599f533f57ffaead1 (patch)
treed6ffded38d53e36cf5075a62242c8a03b21e13b0 /src/map/status.c
parent2503f4ca66cfd8c7014d099883ca696082c27a39 (diff)
downloadhercules-00be89f64050ff5373a63cc599f533f57ffaead1.tar.gz
hercules-00be89f64050ff5373a63cc599f533f57ffaead1.tar.bz2
hercules-00be89f64050ff5373a63cc599f533f57ffaead1.tar.xz
hercules-00be89f64050ff5373a63cc599f533f57ffaead1.zip
Improving the r13888 crashfix to cover similar crash scenarios discovered:
Reordered code in status_change_end(SC_DANCING) so that an ensemble's skill unit group is deleted only after removing both performers' status changes. Modified the call to skill_delunitgroup() IN status_change_end(SC_DANCING) so that it always processes the group's true owner and not others (bugreport:3253). Replaced calls to skill_stop_dancing() with status_change_end(SC_DANCING), since it now provides identical functionality. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13891 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 5f24e244d..62170bf27 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -710,7 +710,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
}
}
if(sc->data[SC_DANCING] && (unsigned int)hp > status->max_hp>>2)
- skill_stop_dancing(target);
+ status_change_end(target, SC_DANCING, -1);
}
unit_skillcastcancel(target, 2);
}
@@ -5947,7 +5947,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
pc_setstand(sd);
case SC_TRICKDEAD:
unit_stop_attack(bl);
- skill_stop_dancing(bl);
+ status_change_end(bl, SC_DANCING, -1);
// Cancel cast when get status [LuzZza]
if (battle_config.sc_castcancel&bl->type)
unit_skillcastcancel(bl, 0);
@@ -6205,9 +6205,6 @@ int status_change_clear(struct block_list* bl, int type)
if (!sc || !sc->count)
return 0;
- if(sc->data[SC_DANCING])
- skill_stop_dancing(bl);
-
for(i = 0; i < SC_MAX; i++)
{
if(!sc->data[i])
@@ -6426,25 +6423,29 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid)
struct map_session_data *dsd;
struct status_change_entry *dsc;
struct skill_unit_group *group;
- if(sce->val2)
- {
- group = skill_id2group(sce->val2);
- sce->val2 = 0;
- skill_delunitgroup(bl, group);
- }
- if(sce->val4 && sce->val4 != BCT_SELF && (dsd=map_id2sd(sce->val4))){
- dsc = dsd->sc.data[type];
+
+ if(sce->val4 && sce->val4 != BCT_SELF && (dsd=map_id2sd(sce->val4)))
+ {// end status on partner as well
+ dsc = dsd->sc.data[SC_DANCING];
if(dsc)
{ //This will prevent recursive loops.
dsc->val2 = dsc->val4 = 0;
- status_change_end(&dsd->bl, type, -1);
+ status_change_end(&dsd->bl, SC_DANCING, -1);
}
}
- }
- if ((sce->val1&0xFFFF) == CG_MOONLIT)
- clif_status_change(bl,SI_MOONLIT,0,0);
- status_change_end(bl,SC_LONGING,-1);
+ if(sce->val2)
+ {// erase associated land skill
+ group = skill_id2group(sce->val2);
+ sce->val2 = 0;
+ skill_delunitgroup(NULL, group);
+ }
+
+ if((sce->val1&0xFFFF) == CG_MOONLIT)
+ clif_status_change(bl,SI_MOONLIT,0,0);
+
+ status_change_end(bl,SC_LONGING,-1);
+ }
break;
case SC_NOCHAT:
if (sd && sd->status.manner < 0 && tid != -1)
@@ -7059,10 +7060,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr data)
if (sc->data[SC_LONGING])
sp*= 3;
if (!status_charge(bl, 0, sp))
- {
- skill_stop_dancing(bl);
- return 0;
- }
+ break;
}
sc_timer_next(1000+tick, status_change_timer, bl->id, data);
return 0;