Issue information

Issue ID
#3097
Status
Fixed
Severity
None
Started
Hercules Elf Bot
May 19, 2009 10:52
Last Post
Hercules Elf Bot
May 19, 2009 10:52
Confirmation
N/A

Hercules Elf Bot - May 19, 2009 10:52

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3097

Quote: It seems the change (r13676) breaks items that give neutral damage reduction. Ex. Raydric card no longer works on monster attacks, and I'm sure there's a few other items that reduce neutral as well.

The change in question did this:
CODE
Index: trunk/src/map/battle.c
===================================================================
--- a/trunk/src/map/battle.c
+++ b/trunk/src/map/battle.c
@@ -1031,4 +1031,6 @@
         if (flag.arrow && sd && sd->arrow_ele)
             s_ele = sd->arrow_ele;
+        if (battle_config.attack_attr_none&src->type)
+            nk|=NK_NO_ELEFIX; //Weapon's element is "not elemental"
     } else if (s_ele == -2) { //Use enchantment's element
         s_ele = s_ele_ = status_get_attack_sc_element(src,sc);
@@ -1887,6 +1889,5 @@
         ATK_ADD(15*skill_lv);

-    if(!(nk&NK_NO_ELEFIX || (s_ele == ELE_NEUTRAL &&
-        battle_config.attack_attr_none&src->type)))
+    if(!(nk&NK_NO_ELEFIX))
     {   //Elemental attribute fix
         if (wd.damage > 0)

There is no problem with calculations inside that "elemental attribute fix" block. However, setting NK_NO_ELEFIX also influences code further on, specifically
CODE
                if (!(nk&NK_NO_ELEFIX))
                    cardfix=cardfix*(100+sd->right_weapon.addele[tstatus->def_ele]+sd->arrow_addele[tstatus->def_ele])/100;
and
CODE
        if( !(nk&NK_NO_ELEFIX) )
            cardfix=cardfix*(100-tsd->subele[s_ele])/100;

This causes item-based elemental damage modifiers to disappear.