From c227b5e71701c10667c194deb634ad789c6503bc Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Sat, 13 Mar 2021 15:33:13 +0100 Subject: [PATCH] Merge client/input.qc and server/input.qc into shared/input.qc --- src/client/init.qc | 6 ------ src/client/progs.src | 2 -- src/server/defs.h | 2 ++ src/server/progs.src | 4 ++-- src/shared/include.src | 1 + src/{server => shared}/input.qc | 33 ++++++++++++--------------------- 6 files changed, 17 insertions(+), 31 deletions(-) rename src/{server => shared}/input.qc (79%) diff --git a/src/client/init.qc b/src/client/init.qc index 562533a..f992e0d 100644 --- a/src/client/init.qc +++ b/src/client/init.qc @@ -60,10 +60,4 @@ ClientGame_RendererRestart(string rstr) precache_model("sprites/tfchud05.spr"); precache_model("sprites/tfchud06.spr"); precache_model("sprites/tfchud07.spr"); - - precache_model("sprites/chainsaw.spr"); - precache_model("sprites/hammer.spr"); - precache_model("sprites/w_cannon.spr"); - - BEAM_TRIPMINE = particleeffectnum("weapon_tripmine.beam"); } diff --git a/src/client/progs.src b/src/client/progs.src index 65bec8b..4a0d8fc 100755 --- a/src/client/progs.src +++ b/src/client/progs.src @@ -19,7 +19,6 @@ ../../../src/gs-entbase/shared.src ../shared/include.src -../../../valve/src/client/predict.qc init.qc ../../../valve/src/client/player.qc entities.qc @@ -30,7 +29,6 @@ entities.qc ../../../valve/src/client/hud.qc ../../../valve/src/client/hud_weaponselect.qc ../../../valve/src/client/scoreboard.qc -../../../valve/src/client/input.qc ../../../base/src/client/modelevent.qc ../../../src/client/include.src diff --git a/src/server/defs.h b/src/server/defs.h index 465ac3d..08a9ec2 100644 --- a/src/server/defs.h +++ b/src/server/defs.h @@ -16,3 +16,5 @@ #include "gamerules.h" #include "../../../valve/src/server/items.h" +#include "../../../valve/src/server/player.h" +#include "../../../valve/src/server/flashlight.h" diff --git a/src/server/progs.src b/src/server/progs.src index 4f4ae45..297ffd5 100755 --- a/src/server/progs.src +++ b/src/server/progs.src @@ -15,10 +15,11 @@ ../../../src/gs-entbase/server.src ../../../src/gs-entbase/shared.src -../shared/include.src defs.h +../shared/include.src + ../../../valve/src/server/player.qc ../../../valve/src/server/spectator.qc @@ -37,7 +38,6 @@ server.qc ../../../src/botlib/include.src -input.qc spawn.qc ../../../src/server/include.src diff --git a/src/shared/include.src b/src/shared/include.src index 5ec32ab..6dff5fb 100644 --- a/src/shared/include.src +++ b/src/shared/include.src @@ -38,4 +38,5 @@ w_umbrella.qc w_wrench.qc weapons.qc ../../../valve/src/shared/weapon_common.qc +input.qc #endlist diff --git a/src/server/input.qc b/src/shared/input.qc similarity index 79% rename from src/server/input.qc rename to src/shared/input.qc index 440082b..37a590b 100644 --- a/src/server/input.qc +++ b/src/shared/input.qc @@ -17,16 +17,7 @@ void Game_Input(void) { - if (input_buttons & INPUT_BUTTON0) { - Weapons_Primary(); - } else if (input_buttons & INPUT_BUTTON4) { - Weapons_Reload(); - } else if (input_buttons & INPUT_BUTTON3) { - Weapons_Secondary(); - } else { - Weapons_Release(); - } - +#ifdef SERVER if (input_buttons & INPUT_BUTTON5) { Player_UseDown(); } else { @@ -37,17 +28,17 @@ Game_Input(void) Flashlight_Toggle(); } - if (cvar("sv_cheats") == 1) { - player pl = (player)self; - if (self.impulse == 102) { - // Respawn all the entities - for (entity a = world; (a = findfloat(a, ::identity, 1));) { - CBaseEntity caw = (CBaseEntity)a; - caw.Respawn(); - } - bprint(PRINT_HIGH, "Respawning all map entities...\n"); - } - } self.impulse = 0; +#endif + + if (input_buttons & INPUT_BUTTON0) { + Weapons_Primary(); + } else if (input_buttons & INPUT_BUTTON4) { + Weapons_Reload(); + } else if (input_buttons & INPUT_BUTTON3) { + Weapons_Secondary(); + } else { + Weapons_Release(); + } }