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:20:43 +01:00
parent f2c4d1b0b0
commit b0303c1098
4 changed files with 14 additions and 1 deletions

View file

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

View file

@ -595,6 +595,7 @@ extern cvar_t *password;
extern cvar_t *spectator_password; extern cvar_t *spectator_password;
extern cvar_t *g_select_empty; extern cvar_t *g_select_empty;
extern cvar_t *dedicated; extern cvar_t *dedicated;
extern cvar_t *g_footsteps;
extern cvar_t *filterban; extern cvar_t *filterban;

View file

@ -1089,7 +1089,17 @@ G_SetClientEvent(edict_t *ent)
return; 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) if ((int)(current_client->bobtime + bobmove) != bobcycle)
{ {

View file

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