WoWInterface - View Single Post - Lua Error Help with LiteStats and OrderHall Page
View Single Post
02-10-17, 11:55 AM   #4
A Chromatic Dragonspawn
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 176
You can do

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

	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
		self:Debug("Found coordinates")
		Xposition = addon:round(posX, 2)
		Yposition = addon:round(posY, 2)
Better to fail then never have tried at all.

Last edited by Yukyuk : 02-10-17 at 12:00 PM.
  Reply With Quote