GatherLite

GatherLite

1M Downloads

Nil value for nodes in an instance

Byron-Miles opened this issue ยท 1 comments

commented

Describe the bug
Nil value for postion variables when querying GatherLite:IsNodeInRange(myPosX, myPosY, nodePosX, nodePosY, spellType) in an instance.

To Reproduce
Steps to reproduce the behavior:

  1. Go to an instance
  2. Open a chest

Potential Fix
Add a check for nil values, for example:

function GatherLite:IsNodeInRange(myPosX, myPosY, nodePosX, nodePosY, spellType)
    if myPosX and myPosY and nodePosX and nodePosY then
        local distance = ((((myPosX - nodePosX) ^ 2) + ((myPosY - nodePosY) ^ 2)) ^ 0.5)
        return distance < 0.0065
    end
    return false
end
commented

Fixed!