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`
This commit is contained in:
Yamagi 2021-03-02 15:14:23 +01:00
parent 5e7fc8fbb0
commit c6aeffb484
4 changed files with 14 additions and 1 deletions

View file

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

View file

@ -512,6 +512,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

@ -1033,7 +1033,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

@ -213,6 +213,7 @@ InitGame(void)
coop_pickup_weapons = gi.cvar("coop_pickup_weapons", "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);