Add a cvar g_footsteps to control the generation of footstep sound.

1: The Vanilla Quake II behaviour, footsteps are generated when the
   player is faster than 255.
0: Footstep sounds are never generated.
2: Footstep sounds are always generated.

Defaults to `1`, cheat protected to `1`.

Closes #666.
This commit is contained in:
Yamagi 2021-03-02 15:08:23 +01:00
parent 69f029e236
commit ae9a248e9e
6 changed files with 21 additions and 1 deletions

View file

@ -138,6 +138,12 @@ it's `+set busywait 0` (setting the `busywait` cvar) and `-portable`
disable it again before playing Ground Zero maps in co-op. By
default this cvar is disabled (set to 0).
* **g_footsteps**: If set to `1` (the default) footstep sounds are
generated when the player faster than 255. This is the behaviour of
Vanilla Quake II. If set to `2` footestep sound always generated. If
set to `0` footstep sounds are never generated. Cheat protected to
`1`.
* **g_disruptor (Ground Zero only)**: This boolean cvar controls the
availability of the Disruptor weapon to players. The Disruptor is
a weapon that was cut from Ground Zero during development but all

View file

@ -666,6 +666,7 @@ cheatvar_t cheatvars[] = {
{"gl_lightmap", "0"},
{"gl_saturatelighting", "0"},
{"cl_kickangles", "1"},
{"g_footsteps", "1"},
{NULL, NULL}
};

View file

@ -54,6 +54,7 @@ cvar_t *maxspectators;
cvar_t *maxentities;
cvar_t *g_select_empty;
cvar_t *dedicated;
cvar_t *g_footsteps;
cvar_t *filterban;

View file

@ -519,6 +519,7 @@ extern cvar_t *spectator_password;
extern cvar_t *needpass;
extern cvar_t *g_select_empty;
extern cvar_t *dedicated;
extern cvar_t *g_footsteps;
extern cvar_t *filterban;

View file

@ -1026,7 +1026,17 @@ G_SetClientEvent(edict_t *ent)
return;
}
if (ent->groundentity && (xyspeed > 225))
if (g_footsteps->value == 1)
{
if (ent->groundentity && (xyspeed > 225))
{
if ((int)(current_client->bobtime + bobmove) != bobcycle)
{
ent->s.event = EV_FOOTSTEP;
}
}
}
if (g_footsteps->value == 2)
{
if ((int)(current_client->bobtime + bobmove) != bobcycle)
{

View file

@ -236,6 +236,7 @@ InitGame(void)
coop_elevator_delay = gi.cvar("coop_elevator_delay", "1.0", CVAR_ARCHIVE);
skill = gi.cvar("skill", "1", CVAR_LATCH);
maxentities = gi.cvar("maxentities", "1024", CVAR_LATCH);
g_footsteps = gi.cvar("g_footsteps", "1", CVAR_ARCHIVE);
/* change anytime vars */
dmflags = gi.cvar("dmflags", "0", CVAR_SERVERINFO);