From a49e15c5416fae67ed7908e1507acf5c63a38c4b Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Mon, 29 Aug 2016 22:45:28 +0800 Subject: [PATCH] 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). --- src/g_level.cpp | 3 +++ src/p_acs.cpp | 3 ++- src/p_acs.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 60e9b0699..fadfd9245 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -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); } } diff --git a/src/p_acs.cpp b/src/p_acs.cpp index ffac7a78f..c85cc65d6 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -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]); diff --git a/src/p_acs.h b/src/p_acs.h index 243e2ccf3..d26829c61 100644 --- a/src/p_acs.h +++ b/src/p_acs.h @@ -272,6 +272,7 @@ enum SCRIPT_Return = 15, SCRIPT_Event = 16, // [BB] SCRIPT_Kill = 17, // [JM] + SCRIPT_Reopen = 18, // [Nash] }; // Script flags