I am using your Add-on for a while and always had the problem that the original rangeCheck did not work properly.
So I looked at your helper.lua and tried out a different approach with LibRangeCheck-2.0 which worked for me.
Here is the new coding beginning with line 258 in the helper.lua:
- local rc = LibStub("LibRangeCheck-2.0");
- function MaxDps:IsSpellInRange(spell, unit)
- unit = unit or 'target';
- local inRange = 0;
- local spellName, spellRank, spellIcon, spellCastingTime, spellMinRange, spellMaxRange, spellID = GetSpellInfo(spell);
- local rangeChecker = rc:GetHarmMaxChecker(spellMaxRange);
- if rangeChecker(unit) == nil then
- local booktype = 'spell';
- local myIndex = MaxDps:FindSpellInSpellbook(spell)
- if myIndex then
- return IsSpellInRange(myIndex, booktype, unit);
- end
- return inRange;
- elseif rangeChecker(unit) == true then
- inRange = 1;
- end
- -- print("Unit ", unit, " in range ? ", inRange);
- return inRange;
- end
Additionally I had to add the LibRangeCheck-2.0 ACE-Addon to my Interfaces and added the line:
- Libs\LibRangeCheck-2.0\LibRangeCheck-2.0.lua
To be honest, I am not sure what I am doing since it is the first time editing an add-on or even working with lua.
But it may be helpfull anyways.
Best regards,
EFiNiTi
