Server: Add cvar 'mp_foosteps', which only works in multiplayer. Hence the name.
This commit is contained in:
parent
18d03b7367
commit
2735bd26f6
2 changed files with 22 additions and 0 deletions
|
@ -264,6 +264,11 @@ Footsteps_Update(void)
|
|||
{
|
||||
NSClientPlayer pl;
|
||||
|
||||
/* mp_footsteps is only available in MP matches */
|
||||
if (Util_IsSingleplayer() == false)
|
||||
if (autocvar(mp_footsteps, 1) == 0)
|
||||
return;
|
||||
|
||||
if (self.classname != "player")
|
||||
return;
|
||||
|
||||
|
|
|
@ -298,3 +298,20 @@ string Util_FixModel(string mdl)
|
|||
|
||||
return mdl;
|
||||
}
|
||||
|
||||
bool
|
||||
Util_IsSingleplayer(void)
|
||||
{
|
||||
#ifdef SERVER
|
||||
/* playerslots 1 is always singleplayer */
|
||||
if (cvar("sv_playerslots") == 1)
|
||||
return true;
|
||||
|
||||
/* only when coop is 1, only in multiplayer */
|
||||
if (cvar("coop") == 1 && cvar("sv_playerslots") > 1)
|
||||
return true;
|
||||
#endif
|
||||
|
||||
/* else we're multiplayer */
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue