Add cvar machinegun_norecoil

Add cvar machinegun_norecoil
This cvar allows to disable machinegun recoil in single player.
The default value is the original Quake 2 behaviour.
This commit is contained in:
De-Seppe 2021-09-27 13:14:38 +02:00
parent 19a6d805a9
commit 73beecec44
4 changed files with 4 additions and 1 deletions

View file

@ -75,6 +75,7 @@ cvar_t *randomrespawn;
cvar_t *g_disruptor; cvar_t *g_disruptor;
cvar_t *aimfix; cvar_t *aimfix;
cvar_t *machinegun_norecoil;
void SpawnEntities(char *mapname, char *entities, char *spawnpoint); void SpawnEntities(char *mapname, char *entities, char *spawnpoint);
void ClientThink(edict_t *ent, usercmd_t *cmd); void ClientThink(edict_t *ent, usercmd_t *cmd);

View file

@ -634,6 +634,7 @@ extern cvar_t *randomrespawn;
extern cvar_t *g_disruptor; extern cvar_t *g_disruptor;
extern cvar_t *aimfix; extern cvar_t *aimfix;
extern cvar_t *machinegun_norecoil;
/* this is for the count of monsters */ /* this is for the count of monsters */
#define ENT_SLOTS_LEFT \ #define ENT_SLOTS_LEFT \

View file

@ -1475,7 +1475,7 @@ Machinegun_Fire(edict_t *ent)
ent->client->kick_angles[0] = ent->client->machinegun_shots * -1.5; ent->client->kick_angles[0] = ent->client->machinegun_shots * -1.5;
/* raise the gun as it is firing */ /* raise the gun as it is firing */
if (!deathmatch->value) if (!(deathmatch->value || machinegun_norecoil->value))
{ {
ent->client->machinegun_shots++; ent->client->machinegun_shots++;

View file

@ -259,6 +259,7 @@ InitGame(void)
/* others */ /* others */
aimfix = gi.cvar("aimfix", "0", CVAR_ARCHIVE); aimfix = gi.cvar("aimfix", "0", CVAR_ARCHIVE);
machinegun_norecoil = gi.cvar("machinegun_norecoil", "0", CVAR_ARCHIVE);
/* items */ /* items */
InitItems (); InitItems ();