summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-07-04 06:12:48 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-07-04 06:12:48 +0200
commitd3311cd34169008f0ba67a11c2f3353ab565c343 (patch)
tree67a934a61c7ea3804e36a16aa8637d44b0322553
parentdad6f5e719957f75b5418216ee22d84c2c2bf2b0 (diff)
downloadhercules-d3311cd34169008f0ba67a11c2f3353ab565c343.tar.gz
hercules-d3311cd34169008f0ba67a11c2f3353ab565c343.tar.bz2
hercules-d3311cd34169008f0ba67a11c2f3353ab565c343.tar.xz
hercules-d3311cd34169008f0ba67a11c2f3353ab565c343.zip
Use sstatus->def_ele instead of status_get_element(src)
-rw-r--r--src/map/battle.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 98569f436..efc82c27f 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1070,16 +1070,14 @@ static int64 battle_calc_cardfix(int attack_type, struct block_list *src, struct
}
// Apply bMagicSubDefEle damage reduction.
- enum elements def_ele = status_get_element(src);
-
if ((src->type == BL_MOB || src->type == BL_PC)
- && !Assert_chk(def_ele >= ELE_NEUTRAL && def_ele < ELE_MAX)) {
+ && !Assert_chk(sstatus->def_ele >= ELE_NEUTRAL && sstatus->def_ele < ELE_MAX)) {
switch (src->type) {
case BL_MOB:
- ele_fix += tsd->magic_sub_def_ele[def_ele].rate_mob;
+ ele_fix += tsd->magic_sub_def_ele[sstatus->def_ele].rate_mob;
break;
case BL_PC:
- ele_fix += tsd->magic_sub_def_ele[def_ele].rate_pc;
+ ele_fix += tsd->magic_sub_def_ele[sstatus->def_ele].rate_pc;
break;
default:
break;
@@ -1254,16 +1252,14 @@ static int64 battle_calc_cardfix(int attack_type, struct block_list *src, struct
}
// Apply bSubDefEle damage reduction.
- enum elements def_ele = status_get_element(src);
-
if ((src->type == BL_MOB || src->type == BL_PC)
- && !Assert_chk(def_ele >= ELE_NEUTRAL && def_ele < ELE_MAX)) {
+ && !Assert_chk(sstatus->def_ele >= ELE_NEUTRAL && sstatus->def_ele < ELE_MAX)) {
switch (src->type) {
case BL_MOB:
- ele_fix = tsd->sub_def_ele[def_ele].rate_mob;
+ ele_fix = tsd->sub_def_ele[sstatus->def_ele].rate_mob;
break;
case BL_PC:
- ele_fix = tsd->sub_def_ele[def_ele].rate_pc;
+ ele_fix = tsd->sub_def_ele[sstatus->def_ele].rate_pc;
break;
default:
break;