Error on item use in instance #27


  • Defect
Open
  • _ForgeUser417984 created this issue Dec 2, 2016

    Analyst was throwing an error when using a potion inside of an instance.

    12x Analyst\Capture.lua:2156: attempt to perform arithmetic on local 'x' (a nil value)
    Analyst\Capture.lua:2156: in function `CreateLocation'
    Analyst\Capture.lua:1692: in function `AddEventProduced'
    Analyst\Capture.lua:703: in function `ScanContainers'
    Analyst\Capture.lua:735: in function `?'
    ...yst\Libs\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:145: in function <...yst\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:145>
    [string "safecall Dispatcher[2]"]:4: in function <[string "safecall Dispatcher[2]"]:4>
    [C]: ?
    [string "safecall Dispatcher[2]"]:13: in function `?'
    ...yst\Libs\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:90: in function `Fire'
    ...ceAnalyst\Libs\AceEvent-3.0\AceEvent-3.0-3.lua:120: in function <...ceAnalyst\Libs\AceEvent-3.0\AceEvent-3.0.lua:119>

    Locals:

    This is due to GetPlayerMapPosition("player") returning nil when inside of a protected instance (since patch 7.1.0) I believe a simple fix is to make the function Analyst:CreateLocation function check the GetPlayerMapPosition results, and if they are nil then return just the zone name, eg:

    function Analyst:CreateLocation ()
    	local zoneText = GetRealZoneText()
    	SetMapToCurrentZone()
    	local x, y = GetPlayerMapPosition("player")
    	if x then
    	   return string.format("%s (%.0f,%.0f)", zoneText, x * 100.0, y * 100.0)
    	else
    	   return zoneText
    	end
    end
    
  • _ForgeUser417984 added a tag Defect Dec 2, 2016

To post a comment, please login or register a new account.