mirror of
https://github.com/wiremod/wire.git
synced 2025-03-04 03:03:04 -05:00
Add e:propSleep(n) to propcore (#3187)
* e:propSleep(n) * Add description * Use :IsValid instead of IsValid Co-authored-by: Denneisk <20892685+Denneisk@users.noreply.github.com> --------- Co-authored-by: Denneisk <20892685+Denneisk@users.noreply.github.com>
This commit is contained in:
parent
95311d6d11
commit
8f8368cc19
@ -63,6 +63,7 @@ E2Helper.Descriptions["propInertia(e:n)"] = "Sets the directional inertia"
|
||||
E2Helper.Descriptions["propInertia(e:v)"] = E2Helper.Descriptions["propInertia(e:n)"]
|
||||
E2Helper.Descriptions["propDraw(e:n)"] = "Passing 0 disables rendering for the entity (makes it really invisible)"
|
||||
E2Helper.Descriptions["propShadow(e:n)"] = "Passing 0 disables rendering for the entity's shadow"
|
||||
E2Helper.Descriptions["propSleep(e:n)"] = "Puts an entity to 'sleep', causing it to stop moving until any physical interaction occurs."
|
||||
E2Helper.Descriptions["propSetBuoyancy(e:n)"] = "Sets the prop's buoyancy ratio from 0 to 1"
|
||||
E2Helper.Descriptions["propSetFriction(e:n)"] = "Sets prop's friction coefficient (default is 1)"
|
||||
E2Helper.Descriptions["propGetFriction(e:)"] = "Gets prop's friction coefficient"
|
||||
@ -128,4 +129,4 @@ E2Helper.Descriptions["entitySurfaceProps(xcd:)"] = E2Helper.Descriptions["ourSu
|
||||
E2Helper.Descriptions["theirSurfaceProps(xcd:)"] = "Returns a number representing the surface properties of the hit entity"
|
||||
E2Helper.Descriptions["hitEntitySurfaceProps(xcd:)"] = E2Helper.Descriptions["theirSurfaceProps(xcd:)"] .. "\nAlias of theirSurfaceProps(xcd:)"
|
||||
E2Helper.Descriptions["deltaTime(xcd:)"] = "Returns a number representing how long ago the last collision between the tracked entity and the hit entity was, in seconds.\nCapped at 1 second."
|
||||
E2Helper.Descriptions["hitEntity(xcd:)"] = "Returns the entity that was hit for this collision."
|
||||
E2Helper.Descriptions["hitEntity(xcd:)"] = "Returns the entity that was hit for this collision."
|
||||
|
@ -832,6 +832,18 @@ e2function void entity:propShadow(number shadowEnable)
|
||||
this:DrawShadow( shadowEnable ~= 0 )
|
||||
end
|
||||
|
||||
e2function void entity:propSleep(number sleep)
|
||||
if not ValidAction(self, this, "sleep") then return end
|
||||
local phys = this:GetPhysicsObject()
|
||||
if phys:IsValid() then
|
||||
if sleep ~= 0 then
|
||||
phys:Sleep()
|
||||
else
|
||||
phys:Wake()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
e2function void entity:propGravity(number gravity)
|
||||
if not ValidAction(self, this, "gravity") then return end
|
||||
local physCount = this:GetPhysicsObjectCount()
|
||||
|
Loading…
Reference in New Issue
Block a user