Added REOPEN script type. These scripts behave just like OPEN scripts, except they will re-execute themselves every time the level is re-entered (ie as part of a hub).

This commit is contained in:
nashmuhandes 2016-08-29 22:45:28 +08:00 committed by Christoph Oelckers
parent 715aa80cf2
commit a49e15c541
3 changed files with 6 additions and 1 deletions

View file

@ -1291,6 +1291,9 @@ void G_FinishTravel ()
if (level.FromSnapshot)
{
FBehavior::StaticStartTypedScripts (SCRIPT_Return, pawn, true);
// [Nash] run REOPEN scripts upon map re-entry
FBehavior::StaticStartTypedScripts(SCRIPT_Reopen, NULL, false);
}
}

View file

@ -2822,7 +2822,8 @@ void FBehavior::StaticStartTypedScripts (WORD type, AActor *activator, bool alwa
"Lightning",
"Unloading",
"Disconnect",
"Return"
"Return",
"Reopen"
};
DPrintf(DMSG_NOTIFY, "Starting all scripts of type %d (%s)\n", type,
type < countof(TypeNames) ? TypeNames[type] : TypeNames[SCRIPT_Lightning - 1]);

View file

@ -272,6 +272,7 @@ enum
SCRIPT_Return = 15,
SCRIPT_Event = 16, // [BB]
SCRIPT_Kill = 17, // [JM]
SCRIPT_Reopen = 18, // [Nash]
};
// Script flags