Only support models of type *_prop_*/prop_*/*_prop. Fixes #1 once again.
parent
63f29c4018
commit
73c3a720c2
|
@ -192,12 +192,12 @@ function SWEP:Undisguise()
|
||||||
// Make sure we have an old model to revert to
|
// Make sure we have an old model to revert to
|
||||||
if (self.UndisguiseAs == nil) then return false end
|
if (self.UndisguiseAs == nil) then return false end
|
||||||
|
|
||||||
// Make sure the new model is not a non-studio model as that
|
// Make sure the new model is actually marked as a prop
|
||||||
// might crash out the server.
|
if (
|
||||||
// I did not yet find a better solution as I was not bothering to
|
!string.sub(string.lower(entity:GetClass()), 1, 5) == "prop_"
|
||||||
// debug it by using the model class. Would take far too long to
|
&& !string.sub(string.lower(entity:GetClass()), -5, 5) == "_prop"
|
||||||
// experiment.
|
&& string.find(string.lower(entity:GetClass()), "_prop_") == nil
|
||||||
if (string.sub(entity:GetModel(), 1, 1) == "*") then return false end
|
) then return false end
|
||||||
|
|
||||||
local owner = self.Owner
|
local owner = self.Owner
|
||||||
local ophysobj = owner:GetPhysicsObject()
|
local ophysobj = owner:GetPhysicsObject()
|
||||||
|
|
Loading…
Reference in New Issue