From d8d3dee46f73d974310a5d18046497087a07a5ad Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 19 Apr 2021 17:20:34 -0400 Subject: [PATCH] Add linedef executor for toggling stagefailed By default, the executor will fail the stage. If Not Climbable is checked, the stage can be completed normally again. --- src/p_setup.c | 2 +- src/p_spec.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/p_setup.c b/src/p_setup.c index 2e7db1055..ec516992e 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3395,7 +3395,7 @@ static void P_InitLevelSettings(void) ssspheres = timeinmap = 0; // Assume Special Stages were failed in unless proven otherwise - via P_GiveEmerald or emerald touchspecial - // Normal stages will default to be OK, unless a Lua script sets to false. + // Normal stages will default to be OK, until a Lua script / linedef executor says otherwise. stagefailed = G_IsSpecialStage(gamemap); // Reset temporary record data diff --git a/src/p_spec.c b/src/p_spec.c index 226e58d15..be120b686 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3902,6 +3902,21 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) } break; + case 466: // Set level failure state + { + if (line->flags & ML_NOCLIMB) + { + stagefailed = false; + CONS_Debug(DBG_GAMELOGIC, "Stage can be completed successfully!\n"); + } + else + { + stagefailed = true; + CONS_Debug(DBG_GAMELOGIC, "Stage will end in failure...\n"); + } + } + break; + case 480: // Polyobj_DoorSlide case 481: // Polyobj_DoorSwing PolyDoor(line);