From acab9d070250b124bdb2a0b7e7ae3c9cfc665cab Mon Sep 17 00:00:00 2001 From: 4n0n <4n0n@tinkr.site> Date: Thu, 2 Feb 2023 13:31:17 -0600 Subject: [PATCH] Add function Unit:IsMounted() function Unit:IsOutdoors() function Unit:IsIndoors() function Unit:IsSubmerged() function Unit:IsDry() --- src/Unit/Unit.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/Unit/Unit.lua b/src/Unit/Unit.lua index 0a711e8..a946e0a 100644 --- a/src/Unit/Unit.lua +++ b/src/Unit/Unit.lua @@ -861,4 +861,34 @@ function Unit:WatchForSwings() end) end +-- ismounted +---@return boolean +function Unit:IsMounted() + return UnitIsMounted(self.unit) +end + +-- isindoors +---@return boolean +function Unit:IsOutdoors() + return ObjectIsOutdoors(self.unit) +end + +-- IsIndoors +---@return boolean +function Unit:IsIndoors() + return not ObjectIsOutdoors(self.unit) +end + +-- IsSubmerged +---@return boolean +function Unit:IsSubmerged() + return ObjectIsSubmerged(self.unit) +end + +-- IsDry +---@return boolean +function Unit:IsDry() + return not ObjectIsSubmerged(self.unit) +end + return Unit