Fixed: wi_noautostartmap was not sync safe

- Make wi_noautostartmap a userinfo cvar. This allows it to be
  communicated across the network and saved in demos. If any player has it
  set, then the intermission screen will not automatically advance to the
  next level.
This commit is contained in:
Randy Heit 2013-09-18 20:45:39 -05:00
parent 8847d5649a
commit 285be8db92
3 changed files with 26 additions and 4 deletions

View file

@ -325,6 +325,10 @@ struct userinfo_t : TMap<FName,FBaseCVar *>
{ {
return *static_cast<FIntCVar *>(*CheckKey(NAME_Gender)); return *static_cast<FIntCVar *>(*CheckKey(NAME_Gender));
} }
bool GetNoAutostartMap() const
{
return *static_cast<FBoolCVar *>(*CheckKey(NAME_Wi_NoAutostartMap));
}
void Reset(); void Reset();
int TeamChanged(int team); int TeamChanged(int team);

View file

@ -568,3 +568,4 @@ xx(NeverSwitchOnPickup)
xx(MoveBob) xx(MoveBob)
xx(StillBob) xx(StillBob)
xx(PlayerClass) xx(PlayerClass)
xx(Wi_NoAutostartMap)

View file

@ -62,7 +62,7 @@ typedef enum
CVAR (Bool, wi_percents, true, CVAR_ARCHIVE) CVAR (Bool, wi_percents, true, CVAR_ARCHIVE)
CVAR (Bool, wi_showtotaltime, true, CVAR_ARCHIVE) CVAR (Bool, wi_showtotaltime, true, CVAR_ARCHIVE)
CVAR (Bool, wi_noautostartmap, false, CVAR_ARCHIVE) CVAR (Bool, wi_noautostartmap, false, CVAR_USERINFO|CVAR_ARCHIVE)
void WI_loadData (); void WI_loadData ();
@ -1098,9 +1098,26 @@ void WI_updateNoState ()
{ {
WI_updateAnimatedBack(); WI_updateAnimatedBack();
if (acceleratestage)
{
cnt = 0;
}
else
{
bool noauto = noautostartmap;
if (!wi_noautostartmap && !noautostartmap) cnt--; for (int i = 0; !noauto && i < MAXPLAYERS; ++i)
if (acceleratestage) cnt=0; {
if (playeringame[i])
{
noauto |= players[i].userinfo.GetNoAutostartMap();
}
}
if (!noauto)
{
cnt--;
}
}
if (cnt == 0) if (cnt == 0)
{ {