Merge pull request #84 from De-Seppe/master

Feature request : add cvar to disable machine gun recoil in single player #741 (rogue)
This commit is contained in:
Yamagi 2021-09-28 18:33:06 +02:00 committed by GitHub
commit f90991db4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 1 deletions

View File

@ -75,6 +75,7 @@ cvar_t *randomrespawn;
cvar_t *g_disruptor;
cvar_t *aimfix;
cvar_t *g_machinegun_norecoil;
void SpawnEntities(char *mapname, char *entities, char *spawnpoint);
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 *aimfix;
extern cvar_t *g_machinegun_norecoil;
/* this is for the count of monsters */
#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;
/* raise the gun as it is firing */
if (!deathmatch->value)
if (!(deathmatch->value || g_machinegun_norecoil->value))
{
ent->client->machinegun_shots++;

View File

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