View Single Post
02-10-17, 11:55 AM   #4
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 179
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
__________________
Better to fail then never have tried at all.

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