summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-27 22:29:59 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-27 22:29:59 +0000
commitaa5e5be5cb646e1e8071557e11eb31b26cfb7073 (patch)
treea031496cfb05b021e2195fa8d5cdc8380bf348d1 /src/map/battle.c
parenta14a1ebf16112348c1b19a31fa4d2ca75d468696 (diff)
downloadhercules-aa5e5be5cb646e1e8071557e11eb31b26cfb7073.tar.gz
hercules-aa5e5be5cb646e1e8071557e11eb31b26cfb7073.tar.bz2
hercules-aa5e5be5cb646e1e8071557e11eb31b26cfb7073.tar.xz
hercules-aa5e5be5cb646e1e8071557e11eb31b26cfb7073.zip
Fixed PA_SACRIFICE crash, bugreport:5371, present since r15277
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15635 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index aa9bdbb62..e777b4507 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -4019,23 +4019,22 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
return (damage_lv)skill_attack(BF_WEAPON,src,src,target,MO_TRIPLEATTACK,skillv,tick,0);
}
- if (sc)
- {
- if (sc->data[SC_SACRIFICE])
- {
+ if (sc) {
+ if (sc->data[SC_SACRIFICE]) {
int skilllv = sc->data[SC_SACRIFICE]->val1;
- /**
- * We need to calculate the DMG before the hp reduction, because it can kill the source.
- * For futher information: bugreport:4950
- **/
- damage_lv ret_val = (damage_lv)skill_attack(BF_WEAPON,src,src,target,PA_SACRIFICE,skilllv,tick,0);
+ damage_lv ret_val;
if( --sc->data[SC_SACRIFICE]->val2 <= 0 )
status_change_end(src, SC_SACRIFICE, INVALID_TIMER);
+ /**
+ * We need to calculate the DMG before the hp reduction, because it can kill the source.
+ * For futher information: bugreport:4950
+ **/
+ ret_val = (damage_lv)skill_attack(BF_WEAPON,src,src,target,PA_SACRIFICE,skilllv,tick,0);
+
status_zap(src, sstatus->max_hp*9/100, 0);//Damage to self is always 9%
- //FIXME: invalid return type!
return ret_val;
}
if (sc->data[SC_MAGICALATTACK])