Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions lua/entities/gmod_wire_expression2/core/custom/prop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -832,9 +832,7 @@ end

[nodiscard]
e2function number entity:propCanSetDupeable()
local isOk, Val = pcall(ValidAction, self, this, "noDupe")
if not isOk then return 0 end

if not IsValid(this) then return self:throw("Invalid entity!", 0) end
return canMarkDupeable(this, self.player) and 1 or 0
end

Expand Down Expand Up @@ -933,7 +931,7 @@ e2function void entity:propSetFriction(number friction)
end

e2function number entity:propGetFriction()
if not ValidAction(self, this, "friction") then return 0 end
if not IsValid(this) then return self:throw("Invalid entity!", 0) end
return this:GetFriction()
end

Expand Down Expand Up @@ -961,10 +959,9 @@ e2function void entity:propPhysicalMaterial(string physprop)
end

e2function string entity:propPhysicalMaterial()
if not ValidAction(self, this, "physprop") then return "" end
if not IsValid(this) then return self:throw("Invalid entity!", "") end
local phys = this:GetPhysicsObject()
if IsValid(phys) then return phys:GetMaterial() or "" end
return ""
return phys:IsValid() and phys:GetMaterial() or ""
end

e2function void entity:propSetVelocity(vector velocity)
Expand Down Expand Up @@ -1238,7 +1235,7 @@ e2function void entity:ragdollSetAng(angle rot)
end

e2function table entity:ragdollGetPose()
if not ValidAction(self, this) then return end
if not IsValid(this) then return self:throw("Invalid entity!", newE2Table()) end
local pose = newE2Table()
local bones = GetBones(this)
local originPos, originAng = bones[0]:GetPos(), bones[0]:GetAngles()
Expand Down
Loading