Skip to content

Commit

Permalink
Add e2 func entity:isAsleep
Browse files Browse the repository at this point in the history
  • Loading branch information
wrefgtzweve committed Dec 14, 2024
1 parent fbe1bed commit f756fb9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/entities/gmod_wire_expression2/core/entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,12 @@ e2function number entity:isFrozen()
if phys:IsMoveable() then return 0 else return 1 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
Expand Down

0 comments on commit f756fb9

Please sign in to comment.