diff --git a/lua/entities/gmod_wire_expression2/core/custom/prop.lua b/lua/entities/gmod_wire_expression2/core/custom/prop.lua index f0e0146dbd..7f64756938 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/prop.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/prop.lua @@ -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 @@ -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 @@ -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) @@ -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()