Refine the g_footstep cvar.

There were complains that always generating footsteps is annoying,
because there will be footsteps while swimming or jumping. Refine
the cvar a little bit:

* `0`: No footsteps at all.
* `1`: Vanilla Quake II behavior.
* `2`: Always footsteps as long as the player has a ground entity.
* `3`: Always footsteps.

The changes the meaning of the values, `2` has become `3`.

Closes yquake2/yquake2#738.
This commit is contained in:
Yamagi 2021-08-25 18:39:09 +02:00
parent 6cc225d670
commit 19a6d805a9

View file

@ -1114,6 +1114,16 @@ G_SetClientEvent(edict_t *ent)
} }
} }
else if (g_footsteps->value == 2) else if (g_footsteps->value == 2)
{
if (ent->groundentity)
{
if ((int)(current_client->bobtime + bobmove) != bobcycle)
{
ent->s.event = EV_FOOTSTEP;
}
}
}
else if (g_footsteps->value >= 3)
{ {
if ((int)(current_client->bobtime + bobmove) != bobcycle) if ((int)(current_client->bobtime + bobmove) != bobcycle)
{ {