Merge client/input.qc and server/input.qc into shared/input.qc

This commit is contained in:
Marco Cawthorne 2021-03-09 11:55:18 +01:00
parent 8b6a4df658
commit 13eb9618f9
5 changed files with 17 additions and 35 deletions

View file

@ -19,7 +19,6 @@
../../../src/gs-entbase/shared.src
../shared/include.src
../../../valve/src/client/predict.qc
../../../valve/src/client/init.qc
../../../valve/src/client/player.qc
../../../valve/src/client/entities.qc
@ -30,7 +29,6 @@
../../../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

View file

@ -16,3 +16,5 @@
#include "gamerules.h"
#include "../../../valve/src/server/items.h"
#include "../../../valve/src/server/flashlight.h"
#include "../../../valve/src/server/player.h"

View file

@ -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/monster_apache.qc
../../../valve/src/server/monster_alien_controller.qc
../../../valve/src/server/monster_alien_grunt.qc
@ -81,7 +82,6 @@ server.qc
../../../src/botlib/include.src
input.qc
../../../valve/src/server/spawn.qc
../../../src/server/include.src

View file

@ -36,4 +36,5 @@ w_chainsaw.qc
w_hammer.qc
weapons.qc
../../../valve/src/shared/weapon_common.qc
input.qc
#endlist

View file

@ -23,16 +23,7 @@ Handles impulse and whatnot
*/
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 {
@ -43,26 +34,16 @@ void 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");
}
if (self.impulse == 103) {
for (entity a = world; (a = find(a, classname, "func_breakable"));) {
func_breakable caw = (func_breakable)a;
caw.Death();
}
bprint(PRINT_HIGH, "BREAK EVERYTHING!\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();
}
}