summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-05-12 00:40:06 +0200
committerHaru <haru@dotalux.com>2015-05-12 00:40:06 +0200
commita56c2ff71c4ab164deda465c8e09e42dc5fd956a (patch)
tree60aa1728096225ac2383e5a922533a2417ed6c67 /src
parent085c4c49df8ed8ec7d1bdf659871f63ceff7b3d3 (diff)
downloadhercules-a56c2ff71c4ab164deda465c8e09e42dc5fd956a.tar.gz
hercules-a56c2ff71c4ab164deda465c8e09e42dc5fd956a.tar.bz2
hercules-a56c2ff71c4ab164deda465c8e09e42dc5fd956a.tar.xz
hercules-a56c2ff71c4ab164deda465c8e09e42dc5fd956a.zip
Follow-up to fff2194
Related: http://hercules.ws/board/tracker/issue-8672-map-server-error/ Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index ad151ac6c..6573ca703 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -4236,12 +4236,12 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
//Initial Values
wd.type=0; //Normal attack
- wd.div_=skill_id?skill->get_num(skill_id,skill_lv):1;
+ wd.div_ = skill_id ? skill->get_num(skill_id,skill_lv) : 1;
wd.amotion=(skill_id && skill->get_inf(skill_id)&INF_GROUND_SKILL)?0:sstatus->amotion; //Amotion should be 0 for ground skills.
if(skill_id == KN_AUTOCOUNTER)
wd.amotion >>= 1;
wd.dmotion=tstatus->dmotion;
- wd.blewcount=skill->get_blewcount(skill_id,skill_lv);
+ wd.blewcount = skill_id ? skill->get_blewcount(skill_id,skill_lv) : 0;
wd.flag = BF_WEAPON; //Initial Flag
wd.flag |= (skill_id||wflag)?BF_SKILL:BF_NORMAL; // Baphomet card's splash damage is counted as a skill. [Inkfish]
wd.dmg_lv=ATK_DEF; //This assumption simplifies the assignation later
@@ -4372,9 +4372,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
return wd;
}
- s_ele = s_ele_ = skill->get_ele(skill_id, skill_lv);
- if( !skill_id || s_ele == -1 )
- { //Take weapon's element
+ s_ele = s_ele_ = skill_id ? skill->get_ele(skill_id, skill_lv) : -1;
+ if (s_ele == -1) {
+ //Take weapon's element
s_ele = sstatus->rhw.ele;
s_ele_ = sstatus->lhw.ele;
if (sd && sd->charm_type != CHARM_TYPE_NONE && sd->charm_count >= MAX_SPIRITCHARM) {
@@ -4385,13 +4385,14 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
s_ele = sd->bonus.arrow_ele;
if( battle_config.attack_attr_none&src->type )
n_ele = true; //Weapon's element is "not elemental"
- }
- else if( s_ele == -2 ) //Use enchantment's element
+ } else if (s_ele == -2) {
+ //Use enchantment's element
s_ele = s_ele_ = status_get_attack_sc_element(src,sc);
- else if( s_ele == -3 ) //Use random element
+ } else if (s_ele == -3) {
+ //Use random element
s_ele = s_ele_ = rnd()%ELE_MAX;
- switch( skill_id )
- {
+ }
+ switch (skill_id) {
case GS_GROUNDDRIFT:
s_ele = s_ele_ = wflag; //element comes in flag.
break;