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:11:37 +02:00
parent f6d8c0fe61
commit aa2a3fcda2
4 changed files with 4 additions and 1 deletions

View File

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

View File

@ -541,6 +541,7 @@ extern cvar_t *flood_waitdelay;
extern cvar_t *sv_maplist;
extern cvar_t *aimfix;
extern cvar_t *machinegun_norecoil;
#define world (&g_edicts[0])

View File

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

View File

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