How the fuck did I even end up putting the last fix under :Undisguise()!?
parent
73c3a720c2
commit
e9de7f4a46
|
@ -106,6 +106,13 @@ function SWEP:Disguise(entity)
|
|||
// Make sure we aren't already that model
|
||||
if (owner:GetModel() == entity:GetModel() && owner:GetSkin() == entity:GetSkin()) then return true end
|
||||
|
||||
// Make sure the new model is actually marked as a prop
|
||||
if (
|
||||
!string.sub(string.lower(entity:GetClass()), 1, 5) == "prop_"
|
||||
&& !string.sub(string.lower(entity:GetClass()), -5, 5) == "_prop"
|
||||
&& string.find(string.lower(entity:GetClass()), "_prop_") == nil
|
||||
) then return false end
|
||||
|
||||
local physobj = entity:GetPhysicsObject()
|
||||
local ophysobj = owner:GetPhysicsObject()
|
||||
|
||||
|
@ -192,13 +199,6 @@ function SWEP:Undisguise()
|
|||
// Make sure we have an old model to revert to
|
||||
if (self.UndisguiseAs == nil) then return false end
|
||||
|
||||
// Make sure the new model is actually marked as a prop
|
||||
if (
|
||||
!string.sub(string.lower(entity:GetClass()), 1, 5) == "prop_"
|
||||
&& !string.sub(string.lower(entity:GetClass()), -5, 5) == "_prop"
|
||||
&& string.find(string.lower(entity:GetClass()), "_prop_") == nil
|
||||
) then return false end
|
||||
|
||||
local owner = self.Owner
|
||||
local ophysobj = owner:GetPhysicsObject()
|
||||
|
||||
|
|
Loading…
Reference in New Issue