From e9de7f4a46fa26a21df07db160dd7449818aef65 Mon Sep 17 00:00:00 2001 From: icedream Date: Sat, 21 Dec 2013 03:57:30 +0100 Subject: [PATCH] How the fuck did I even end up putting the last fix under :Undisguise()!? --- lua/weapons/disguiser/init.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lua/weapons/disguiser/init.lua b/lua/weapons/disguiser/init.lua index 4e7a973..533de40 100644 --- a/lua/weapons/disguiser/init.lua +++ b/lua/weapons/disguiser/init.lua @@ -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()