- renamed the level variables.
currentUILevel is now primaryLevel. For ZScript, currentVMLevel was added. This is also exported as 'level' and will change as needed. This also means that no breaking deprecations will be needed in the future, because in order to sandbox a level only 4 variables need to be handled: level, players, playeringame and consoleplayer. The remaining global variables are not relevant for the level state. The static 'level' has been mostly removed from the code except some places that still need work.
This commit is contained in:
parent
6c006a5fbd
commit
45dc9a7b47
44 changed files with 266 additions and 264 deletions
|
|
@ -65,7 +65,7 @@ bool P_CheckTickerPaused ()
|
|||
&& wipegamestate == gamestate)
|
||||
{
|
||||
// Only the current UI level's settings are relevant for sound.
|
||||
S_PauseSound (!(currentUILevel->flags2 & LEVEL2_PAUSE_MUSIC_IN_MENUS), false);
|
||||
S_PauseSound (!(primaryLevel->flags2 & LEVEL2_PAUSE_MUSIC_IN_MENUS), false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -99,7 +99,7 @@ void P_Ticker (void)
|
|||
|
||||
// [RH] Frozen mode is only changed every 4 tics, to make it work with A_Tracer().
|
||||
// This may not be perfect but it is not really relevant for sublevels that tracer homing behavior is preserved.
|
||||
if ((currentUILevel->maptime & 3) == 0)
|
||||
if ((primaryLevel->maptime & 3) == 0)
|
||||
{
|
||||
if (globalchangefreeze)
|
||||
{
|
||||
|
|
@ -151,18 +151,22 @@ void P_Ticker (void)
|
|||
// [ZZ] call the WorldTick hook
|
||||
E_WorldTick();
|
||||
StatusBar->CallTick (); // [RH] moved this here
|
||||
level.Tick (); // [RH] let the level tick
|
||||
level.Thinkers.RunThinkers(&level);
|
||||
|
||||
//if added by MC: Freeze mode.
|
||||
if (!level.isFrozen())
|
||||
for (auto Level : AllLevels())
|
||||
{
|
||||
P_UpdateSpecials (&level);
|
||||
P_RunEffects(&level); // [RH] Run particle effects
|
||||
}
|
||||
// todo: set up a sandbox for secondary levels here.
|
||||
Level->Tick(); // [RH] let the level tick
|
||||
Level->Thinkers.RunThinkers(Level);
|
||||
|
||||
//if added by MC: Freeze mode.
|
||||
if (!Level->isFrozen())
|
||||
{
|
||||
P_UpdateSpecials(Level);
|
||||
P_RunEffects(Level); // [RH] Run particle effects
|
||||
}
|
||||
|
||||
// for par times
|
||||
level.time++;
|
||||
level.maptime++;
|
||||
level.totaltime++;
|
||||
Level->time++;
|
||||
Level->maptime++;
|
||||
Level->totaltime++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue