Add e2 func entity:isAsleep (#3219)

This commit is contained in:
Redox 2024-12-14 09:44:03 +01:00 committed by GitHub
parent b6c0954b02
commit eb9451ce59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -581,6 +581,12 @@ e2function number entity:isFrozen()
if phys:IsMoveable() then return 0 else return 1 end if phys:IsMoveable() then return 0 else return 1 end
end end
e2function number entity:isAsleep()
if not validPhysics(this) then return self:throw("Invalid entity!", 0) end
local phys = this:GetPhysicsObject()
if phys:IsAsleep() then return 1 else return 0 end
end
--[[******************************************************************************]] --[[******************************************************************************]]
__e2setcost(30) -- temporary __e2setcost(30) -- temporary