PDA

View Full Version : [Bug&Fix] DMG effect's range tag not working



Lycake
May 17th, 2014, 03:58
Hello!
I wanted a DMG effect to be melee only, but had to notice that it is not working. The wiki says it is possible to add a range to the DMG effect. It does not apply the DMG in any circumstance if I do something like:

DMG: 2 melee
or
DMG: 1 ranged

I found the mistake though, it is in the following file of the ruleset:

manager_action_damage.lua lines 358 and 417.

local nEffectMod, nEffectCount = EffectManager.getEffectsBonus(rSource, "DMGW", true, aDamageFilter, rTarget);

aEffects, nEffects = EffectManager.getEffectsBonusByType(rSource, "DMG", true, aDamageFilter, rTarget);

aDamageFilter is never initialized. What the developer intended here was to use the correctly initiated (lines 287-297) attack type filter (for melee, ranged, close and area).
So to fix this, simply replace aDamageFilter with aAttackFilter at lines 358 and 417. Both variables are never used elsewhere, so this will not cause any other problems.

I modified my ruleset myself, but I hope this will be fixed for future updates of FG so others don't have to wonder why this is not working.

greetz,
Cake

damned
May 17th, 2014, 04:49
welcome Lycake - and nice sleuth work.