|
832 | 832 |
|
833 | 833 | [nodiscard] |
834 | 834 | e2function number entity:propCanSetDupeable() |
835 | | - local isOk, Val = pcall(ValidAction, self, this, "noDupe") |
836 | | - if not isOk then return 0 end |
837 | | - |
| 835 | + if not IsValid(this) then return self:throw("Invalid entity!", 0) end |
838 | 836 | return canMarkDupeable(this, self.player) and 1 or 0 |
839 | 837 | end |
840 | 838 |
|
@@ -933,7 +931,7 @@ e2function void entity:propSetFriction(number friction) |
933 | 931 | end |
934 | 932 |
|
935 | 933 | e2function number entity:propGetFriction() |
936 | | - if not ValidAction(self, this, "friction") then return 0 end |
| 934 | + if not IsValid(this) then return self:throw("Invalid entity!", 0) end |
937 | 935 | return this:GetFriction() |
938 | 936 | end |
939 | 937 |
|
@@ -961,10 +959,9 @@ e2function void entity:propPhysicalMaterial(string physprop) |
961 | 959 | end |
962 | 960 |
|
963 | 961 | e2function string entity:propPhysicalMaterial() |
964 | | - if not ValidAction(self, this, "physprop") then return "" end |
| 962 | + if not IsValid(this) then return self:throw("Invalid entity!", "") end |
965 | 963 | local phys = this:GetPhysicsObject() |
966 | | - if IsValid(phys) then return phys:GetMaterial() or "" end |
967 | | - return "" |
| 964 | + return phys:IsValid() and phys:GetMaterial() or "" |
968 | 965 | end |
969 | 966 |
|
970 | 967 | e2function void entity:propSetVelocity(vector velocity) |
@@ -1238,7 +1235,7 @@ e2function void entity:ragdollSetAng(angle rot) |
1238 | 1235 | end |
1239 | 1236 |
|
1240 | 1237 | e2function table entity:ragdollGetPose() |
1241 | | - if not ValidAction(self, this) then return end |
| 1238 | + if not IsValid(this) then return self:throw("Invalid entity!", newE2Table()) end |
1242 | 1239 | local pose = newE2Table() |
1243 | 1240 | local bones = GetBones(this) |
1244 | 1241 | local originPos, originAng = bones[0]:GetPos(), bones[0]:GetAngles() |
|
0 commit comments