Merge remote-tracking branch 'origin/master' into newtimercode4

This commit is contained in:
Rachael Alexanderson 2017-11-15 22:33:27 -05:00
commit e867d75712
5 changed files with 48 additions and 6 deletions

View file

@ -129,7 +129,7 @@ int starttime;
extern FString BackupSaveName;
bool savegamerestore;
int finishstate;
int finishstate = FINISH_NoHub;
extern int mousex, mousey;
extern bool sendpause, sendsave, sendturn180, SendLand;
@ -852,6 +852,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))))
@ -861,7 +863,6 @@ void G_DoCompleted (void)
}
gamestate = GS_INTERMISSION;
finishstate = mode;
viewactive = false;
automapactive = false;
@ -1039,12 +1040,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);
}
}