From 9d27fa953df406738fd384b0b6c6862bc64c2686 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Fri, 7 May 2021 13:52:55 +0200 Subject: [PATCH] Clean up the precaches. We are precaching SO much content twice! --- src/shared/w_broom.qc | 5 +++-- src/shared/w_forks.qc | 5 +++-- src/shared/w_fryingpan.qc | 5 +++-- src/shared/w_glove.qc | 5 +++-- src/shared/w_hairspray.qc | 5 +++-- src/shared/w_knife.qc | 9 +++++---- src/shared/w_legolauncher.qc | 7 ++++--- src/shared/w_machette.qc | 2 +- src/shared/w_sodalauncher.qc | 2 +- 9 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/shared/w_broom.qc b/src/shared/w_broom.qc index a0c7136..6b57ed4 100644 --- a/src/shared/w_broom.qc +++ b/src/shared/w_broom.qc @@ -35,10 +35,11 @@ w_broom_precache(void) Sound_Precache("weapon_broom.hit"); Sound_Precache("weapon_broom.miss"); Sound_Precache("weapon_broom.hitbody"); -#endif - precache_model("models/v_broom.mdl"); precache_model("models/w_broom.mdl"); +#else + precache_model("models/v_broom.mdl"); precache_model("models/p_broom.mdl"); +#endif } void diff --git a/src/shared/w_forks.qc b/src/shared/w_forks.qc index 97253c8..7603f79 100644 --- a/src/shared/w_forks.qc +++ b/src/shared/w_forks.qc @@ -46,11 +46,12 @@ w_forks_precache(void) Sound_Precache("weapon_forks.stick"); Sound_Precache("weapon_forks.throw"); precache_model("models/fork.mdl"); -#endif + precache_model("models/w_fork.mdl"); +#else precache_model("sprites/hud_fork.spr"); precache_model("models/v_fork.mdl"); - precache_model("models/w_fork.mdl"); precache_model("models/p_fork.mdl"); +#endif } void diff --git a/src/shared/w_fryingpan.qc b/src/shared/w_fryingpan.qc index 8c5e390..866f3ca 100644 --- a/src/shared/w_fryingpan.qc +++ b/src/shared/w_fryingpan.qc @@ -32,10 +32,11 @@ w_fryingpan_precache(void) Sound_Precache("weapon_fryingpan.hit"); Sound_Precache("weapon_fryingpan.miss"); Sound_Precache("weapon_fryingpan.hitbody"); -#endif - precache_model("models/v_pan.mdl"); precache_model("models/w_pan.mdl"); +#else + precache_model("models/v_pan.mdl"); precache_model("models/p_pan.mdl"); +#endif } void diff --git a/src/shared/w_glove.qc b/src/shared/w_glove.qc index efa7435..35ab448 100644 --- a/src/shared/w_glove.qc +++ b/src/shared/w_glove.qc @@ -43,10 +43,11 @@ w_glove_precache(void) Sound_Precache("weapon_glove.miss"); Sound_Precache("weapon_glove.hitbody"); Sound_Precache("weapon_glove.pickup"); -#endif - precache_model("models/v_glove.mdl"); precache_model("models/rune_slasher.mdl"); +#else + precache_model("models/v_glove.mdl"); precache_model("models/p_glove.mdl"); +#endif } void diff --git a/src/shared/w_hairspray.qc b/src/shared/w_hairspray.qc index dae0d63..a76cd36 100644 --- a/src/shared/w_hairspray.qc +++ b/src/shared/w_hairspray.qc @@ -37,12 +37,13 @@ w_hairspray_precache(void) { #ifdef SERVER Sound_Precache("weapon_hairspray.fire"); -#endif + precache_model("models/w_hairspray.mdl"); precache_model("sprites/flame.spr"); +#else precache_model("sprites/hud_haircan.spr"); precache_model("models/v_hairspray.mdl"); - precache_model("models/w_hairspray.mdl"); precache_model("models/p_hairspray.mdl"); +#endif } void diff --git a/src/shared/w_knife.qc b/src/shared/w_knife.qc index f7eadfd..01796e0 100644 --- a/src/shared/w_knife.qc +++ b/src/shared/w_knife.qc @@ -41,12 +41,13 @@ w_knife_precache(void) Sound_Precache("weapon_knife.move"); Sound_Precache("weapon_knife.stick"); Sound_Precache("weapon_knife.throw"); -#endif - precache_model("sprites/hud_knife.spr"); - precache_model("models/knife.mdl"); - precache_model("models/v_knife.mdl"); precache_model("models/w_knife.mdl"); + precache_model("models/knife.mdl"); +#else + precache_model("sprites/hud_knife.spr"); + precache_model("models/v_knife.mdl"); precache_model("models/p_knife.mdl"); +#endif } void diff --git a/src/shared/w_legolauncher.qc b/src/shared/w_legolauncher.qc index 8045b34..4ff8579 100644 --- a/src/shared/w_legolauncher.qc +++ b/src/shared/w_legolauncher.qc @@ -38,11 +38,12 @@ w_legolauncher_precache(void) Sound_Precache("weapon_legolauncher.fire"); Sound_Precache("weapon_legolauncher.hit"); Sound_Precache("weapon_legolauncher.hitbody"); -#endif - precache_model("models/lego.mdl"); - precache_model("models/v_legolauncher.mdl"); precache_model("models/w_legolauncher.mdl"); + precache_model("models/lego.mdl"); +#else + precache_model("models/v_legolauncher.mdl"); precache_model("models/p_legolauncher.mdl"); +#endif } void diff --git a/src/shared/w_machette.qc b/src/shared/w_machette.qc index af9a232..4d9c990 100644 --- a/src/shared/w_machette.qc +++ b/src/shared/w_machette.qc @@ -33,9 +33,9 @@ w_machette_precache(void) Sound_Precache("weapon_crowbar.miss"); Sound_Precache("weapon_crowbar.hitbody"); precache_model("models/machette.mdl"); + precache_model("models/rune_stalker.mdl"); #else precache_model("models/v_machette.mdl"); - precache_model("models/rune_stalker.mdl"); precache_model("models/p_machette.mdl"); #endif } diff --git a/src/shared/w_sodalauncher.qc b/src/shared/w_sodalauncher.qc index 426997c..2535235 100644 --- a/src/shared/w_sodalauncher.qc +++ b/src/shared/w_sodalauncher.qc @@ -44,11 +44,11 @@ w_sodalauncher_precache(void) Sound_Precache("weapon_sodalauncher.fire"); Sound_Precache("weapon_sodalauncher.explode"); precache_model("models/sodacan.mdl"); + precache_model("models/w_soda.mdl"); #else precache_model("sprites/hud_sodacan.spr"); precache_model("sprites/co2_puff.spr"); precache_model("models/v_soda.mdl"); - precache_model("models/w_soda.mdl"); precache_model("models/p_soda.mdl"); #endif }