diff --git a/ClassicAPI.lua b/ClassicAPI.lua index ead25e4..cfa34d6 100644 --- a/ClassicAPI.lua +++ b/ClassicAPI.lua @@ -337,6 +337,18 @@ function API.IsMounted() return IsMounted() and true or false end +-- True if the player is under a WMO roof (building, cave, instance interior). +-- Live engine geometry query, not zone-based; nil (-> false) pre-world. +function API.IsIndoors() + return IsIndoors() and true or false +end + +-- True if the player is outdoors (open sky / not inside a WMO interior). +-- Exact complement of IsIndoors for a resolvable player. +function API.IsOutdoors() + return IsOutdoors() and true or false +end + -- Player's stand state: 0 = standing, non-zero = sitting/sleeping/kneeling/etc. -- (see UnitStandState). Player-only. function API.GetPlayerStandState() diff --git a/Conditionals.lua b/Conditionals.lua index 18fafa5..43f268b 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -7352,6 +7352,26 @@ CleveRoids.Keywords = { return not CleveRoids.ClassicAPI.IsSwimming() end, + -- [indoors] - Player is under a WMO roof (building, cave, instance interior) + indoors = function(conditionals) + return CleveRoids.ClassicAPI.IsIndoors() + end, + + -- [noindoors] - Player is NOT indoors + noindoors = function(conditionals) + return not CleveRoids.ClassicAPI.IsIndoors() + end, + + -- [outdoors] - Player is outdoors (open sky / not inside a WMO interior) + outdoors = function(conditionals) + return CleveRoids.ClassicAPI.IsOutdoors() + end, + + -- [nooutdoors] - Player is NOT outdoors + nooutdoors = function(conditionals) + return not CleveRoids.ClassicAPI.IsOutdoors() + end, + -- [rooted] - Player is currently rooted (Nampower v2.36+) rooted = function(conditionals) if not CleveRoids.NampowerAPI.features.hasPlayerIsRooted then @@ -9371,6 +9391,7 @@ CleveRoids.STATIC_CONDITIONALS = { mod = true, nomod = true, keydown = true, nokeydown = true, swimming = true, noswimming = true, swim = true, noswim = true, + indoors = true, noindoors = true, outdoors = true, nooutdoors = true, rooted = true, norooted = true, resting = true, noresting = true, } diff --git a/Core.lua b/Core.lua index 1b829ff..ded6587 100644 --- a/Core.lua +++ b/Core.lua @@ -153,6 +153,10 @@ local BOOLEAN_CONDITIONALS = { noohenchant = true, locked = true, nolocked = true, + indoors = true, + noindoors = true, + outdoors = true, + nooutdoors = true, group = true, nogroup = true, moving = true,