summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-04-10 19:45:56 -0300
committershennetsind <ind@henn.et>2013-04-10 19:45:56 -0300
commita59be8328048f628cd200996b5d4a530a4d99cea (patch)
treee00550fd3d934afcd8cf61bba78762074fe55ae8 /src/map/skill.c
parenta97aab1e2e54503483cfa0102e881122420d39ec (diff)
downloadhercules-a59be8328048f628cd200996b5d4a530a4d99cea.tar.gz
hercules-a59be8328048f628cd200996b5d4a530a4d99cea.tar.bz2
hercules-a59be8328048f628cd200996b5d4a530a4d99cea.tar.xz
hercules-a59be8328048f628cd200996b5d4a530a4d99cea.zip
Fixed reflect-damage loop that'd result to a crash
Special Thanks to jTynne! Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index d686bef7f..e393e4293 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2698,8 +2698,16 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
if( rdamage > 0 ) {
if( sc && sc->data[SC_REFLECTDAMAGE] ) {
- if( src != bl )// Don't reflect your own damage (Grand Cross)
+ if( src != bl ) {// Don't reflect your own damage (Grand Cross)
+ bool change = false;
+ if( sd && !sd->state.autocast )
+ change = true;
+ if( change )
+ sd->state.autocast = 1;
map_foreachinshootrange(battle->damage_area,bl,skill->get_splash(LG_REFLECTDAMAGE,1),BL_CHAR,tick,bl,dmg.amotion,sstatus->dmotion,rdamage,tstatus->race);
+ if( change )
+ sd->state.autocast = 0;
+ }
} else {
if( dmg.amotion )
battle->delay_damage(tick, dmg.amotion,bl,src,0,CR_REFLECTSHIELD,0,rdamage,ATK_DEF,0,additional_effects);