You can do
Code:
local isInstance, instanceType = IsInInstance()
This will tell you if you are in an Instance (isInstance = true or false) and what type of instance
instanceType =
"none" when outside an instance
"pvp" when in a battleground
"arena" when in an arena
"party" when in a 5-man instance
"raid" when in a raid instance
"scenario" when in a scenario
The workaround I now use for Deathcounter
Code:
posX, posY = GetPlayerMapPosition("player")
if posX == nil and posY == nil then
self:Debug("Default coordinates")
posX = 0.5
posY = 0.5
Xposition = 0.5
Yposition = 0.5
else
self:Debug("Found coordinates")
Xposition = addon:round(posX, 2)
Yposition = addon:round(posY, 2)
end