mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-15 17:11:24 +00:00
- fixed portal restoration on revisiting level in hub
Added function to FLevelLocals to test if map is being reentered
https://forum.zdoom.org/viewtopic.php?t=60455
(cherry picked from commit 29d2e77840
)
This commit is contained in:
parent
ed5c2b21ac
commit
807695783f
3 changed files with 8 additions and 2 deletions
|
@ -166,6 +166,12 @@ struct FLevelLocals
|
||||||
return headgamenode;
|
return headgamenode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if level is loaded from saved game or is being revisited as a part of a hub
|
||||||
|
bool IsReentering() const
|
||||||
|
{
|
||||||
|
return savegamerestore
|
||||||
|
|| (info != nullptr && info->Snapshot.mBuffer != nullptr && info->isValid());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
extern FLevelLocals level;
|
extern FLevelLocals level;
|
||||||
|
|
|
@ -4102,7 +4102,7 @@ void P_SetupLevel (const char *lumpname, int position)
|
||||||
times[16].Clock();
|
times[16].Clock();
|
||||||
if (reloop) P_LoopSidedefs (false);
|
if (reloop) P_LoopSidedefs (false);
|
||||||
PO_Init (); // Initialize the polyobjs
|
PO_Init (); // Initialize the polyobjs
|
||||||
if (!savegamerestore)
|
if (!level.IsReentering())
|
||||||
P_FinalizePortals(); // finalize line portals after polyobjects have been initialized. This info is needed for properly flagging them.
|
P_FinalizePortals(); // finalize line portals after polyobjects have been initialized. This info is needed for properly flagging them.
|
||||||
times[16].Unclock();
|
times[16].Unclock();
|
||||||
|
|
||||||
|
|
|
@ -477,7 +477,7 @@ void S_Start ()
|
||||||
|
|
||||||
// Don't start the music if loading a savegame, because the music is stored there.
|
// Don't start the music if loading a savegame, because the music is stored there.
|
||||||
// Don't start the music if revisiting a level in a hub for the same reason.
|
// Don't start the music if revisiting a level in a hub for the same reason.
|
||||||
if (!savegamerestore && (level.info == nullptr || level.info->Snapshot.mBuffer == nullptr || !level.info->isValid()))
|
if (!level.IsReentering())
|
||||||
{
|
{
|
||||||
if (level.cdtrack == 0 || !S_ChangeCDMusic (level.cdtrack, level.cdid))
|
if (level.cdtrack == 0 || !S_ChangeCDMusic (level.cdtrack, level.cdid))
|
||||||
S_ChangeMusic (level.Music, level.musicorder);
|
S_ChangeMusic (level.Music, level.musicorder);
|
||||||
|
|
Loading…
Reference in a new issue