From 72f305e0041f2cd44732659d9697975b37a33a1d Mon Sep 17 00:00:00 2001 From: icedream Date: Sat, 21 Dec 2013 20:29:06 +0100 Subject: [PATCH] Only avoid disguising when color also matches. Fixes #7. Also removed AllowFullRotation code. --- lua/weapons/disguiser/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/weapons/disguiser/init.lua b/lua/weapons/disguiser/init.lua index 9539ce0..a40870e 100644 --- a/lua/weapons/disguiser/init.lua +++ b/lua/weapons/disguiser/init.lua @@ -105,7 +105,9 @@ function SWEP:Disguise(entity) local owner = self.Owner // Make sure we aren't already that model - if (owner:GetModel() == entity:GetModel() && owner:GetSkin() == entity:GetSkin()) then return true end + if (owner:GetModel() == entity:GetModel() + && owner:GetSkin() == entity:GetSkin() + && owner:GetColor() == entity:GetColor()) then return true end // Make sure the new model is actually marked as a prop if ( @@ -125,7 +127,6 @@ function SWEP:Disguise(entity) self.UndisguiseAsColor = owner:GetColor() self.UndisguiseAsBloodColor = owner:GetBloodColor() self.UndisguiseAsSolid = owner:GetSolid() - self.UndisguiseAsFullRotation = owner:GetAllowFullRotation() end // Disguise as given model @@ -212,7 +213,6 @@ function SWEP:Undisguise() end owner:SetColor(self.UndisguiseAsColor) owner:SetSolid(self.UndisguiseAsSolid) - owner:SetAllowFullRotation(self.UndisguiseAsFullRotation) // up/down rotation owner:SetBloodColor(self.UndisguiseAsBloodColor) // Revert to old physics