From 2555495d0754be12e3de4edc9e1b2e67da1d4ac7 Mon Sep 17 00:00:00 2001 From: icedream Date: Sat, 21 Dec 2013 11:25:28 +0100 Subject: [PATCH] Precache weapon inside SWEP:Precache hook. Fixes #3. --- lua/weapons/disguiser/sh_init.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/weapons/disguiser/sh_init.lua b/lua/weapons/disguiser/sh_init.lua index ed5d855..935e1e1 100644 --- a/lua/weapons/disguiser/sh_init.lua +++ b/lua/weapons/disguiser/sh_init.lua @@ -51,10 +51,6 @@ SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "none" -// Precache models -util.PrecacheModel(SWEP.ViewModel) -util.PrecacheModel(SWEP.WorldModel) - // Sounds SWEP.Sounds = { Disguise = { @@ -112,6 +108,13 @@ for soundName, soundPaths in pairs(SWEP.Sounds) do }) end +// Precache models +function SWEP:Precache() + util.PrecacheModel(SWEP.ViewModel) + util.PrecacheModel(SWEP.WorldModel) +end + +// Shooting effect function SWEP:DoShootEffect(hitpos, hitnormal, entity, physbone, bFirstTimePredicted) if SERVER then