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:
parent
9132c558d4
commit
41a134a195
|
@ -86,6 +86,7 @@ cvar_t *sv_maplist;
|
||||||
cvar_t *gib_on;
|
cvar_t *gib_on;
|
||||||
|
|
||||||
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);
|
||||||
|
|
|
@ -549,6 +549,7 @@ extern cvar_t *flood_waitdelay;
|
||||||
extern cvar_t *sv_maplist;
|
extern cvar_t *sv_maplist;
|
||||||
|
|
||||||
extern cvar_t *aimfix;
|
extern cvar_t *aimfix;
|
||||||
|
extern cvar_t *machinegun_norecoil;
|
||||||
|
|
||||||
#define world (&g_edicts[0])
|
#define world (&g_edicts[0])
|
||||||
|
|
||||||
|
|
|
@ -1249,7 +1249,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++;
|
||||||
|
|
||||||
|
@ -1258,7 +1258,8 @@ Machinegun_Fire(edict_t *ent)
|
||||||
ent->client->machinegun_shots = 9;
|
ent->client->machinegun_shots = 9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* get start / end positions */
|
/* get start / end positions */
|
||||||
VectorAdd(ent->client->v_angle, ent->client->kick_angles, angles);
|
VectorAdd(ent->client->v_angle, ent->client->kick_angles, angles);
|
||||||
AngleVectors(angles, forward, right, NULL);
|
AngleVectors(angles, forward, right, NULL);
|
||||||
|
|
|
@ -273,6 +273,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();
|
||||||
|
|
Loading…
Reference in New Issue