mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
Fixed return state of player entered event
https://forum.zdoom.org/viewtopic.php?t=58433
This commit is contained in:
parent
1088c60add
commit
285834ae5b
1 changed files with 15 additions and 6 deletions
|
@ -128,7 +128,7 @@ int starttime;
|
|||
extern FString BackupSaveName;
|
||||
|
||||
bool savegamerestore;
|
||||
int finishstate;
|
||||
int finishstate = FINISH_NoHub;
|
||||
|
||||
extern int mousex, mousey;
|
||||
extern bool sendpause, sendsave, sendturn180, SendLand;
|
||||
|
@ -851,6 +851,8 @@ void G_DoCompleted (void)
|
|||
level.maptime = 0;
|
||||
}
|
||||
|
||||
finishstate = mode;
|
||||
|
||||
if (!deathmatch &&
|
||||
((level.flags & LEVEL_NOINTERMISSION) ||
|
||||
((nextcluster == thiscluster) && (thiscluster->flags & CLUSTER_HUB) && !(thiscluster->flags & CLUSTER_ALLOWINTERMISSION))))
|
||||
|
@ -860,7 +862,6 @@ void G_DoCompleted (void)
|
|||
}
|
||||
|
||||
gamestate = GS_INTERMISSION;
|
||||
finishstate = mode;
|
||||
viewactive = false;
|
||||
automapactive = false;
|
||||
|
||||
|
@ -1038,12 +1039,20 @@ void G_DoLoadLevel (int position, bool autosave)
|
|||
{
|
||||
players[ii].camera = players[ii].mo;
|
||||
}
|
||||
if (!savegamerestore)
|
||||
|
||||
if (savegamerestore)
|
||||
{
|
||||
E_PlayerEntered(ii, finishstate == FINISH_SameHub);
|
||||
continue;
|
||||
}
|
||||
|
||||
const bool fromSnapshot = level.FromSnapshot;
|
||||
E_PlayerEntered(ii, fromSnapshot && finishstate == FINISH_SameHub);
|
||||
|
||||
if (fromSnapshot)
|
||||
{
|
||||
// ENTER scripts are being handled when the player gets spawned, this cannot be changed due to its effect on voodoo dolls.
|
||||
FBehavior::StaticStartTypedScripts(SCRIPT_Return, players[ii].mo, true);
|
||||
}
|
||||
// ENTER scripts are being handled when the player gets spawned, this cannot be changed due to its effect on voodoo dolls.
|
||||
if (level.FromSnapshot && !savegamerestore) FBehavior::StaticStartTypedScripts(SCRIPT_Return, players[ii].mo, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue