From 38aa1f9d6b04e3419ee5f7349dbb2972fabb5385 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Tue, 17 Oct 2023 03:54:23 -0700 Subject: [PATCH] Waypoint flag to block lightsnake --- src/k_respawn.c | 2 +- src/p_mobj.c | 8 ++++++++ src/p_spec.h | 9 +++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/k_respawn.c b/src/k_respawn.c index cec0f57df..36637b52c 100644 --- a/src/k_respawn.c +++ b/src/k_respawn.c @@ -413,7 +413,7 @@ static void K_MovePlayerToRespawnPoint(player_t *player) { size_t nwp = K_NextRespawnWaypointIndex(player->respawn.wp); - if (nwp == SIZE_MAX) + if (nwp == SIZE_MAX || nextwaypoints[nwp]->mobj->movefactor) // movefactor: Block Lightsnake { player->respawn.state = RESPAWNST_DROP; return; diff --git a/src/p_mobj.c b/src/p_mobj.c index 72d1aada1..1db3b22e3 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -13527,6 +13527,14 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) { mobj->extravalue2 = 0; } + if (mthing->thing_args[2] & TMWPF_BLOCKLIGHTSNAKE) + { + mobj->movefactor = 1; // If a lightsnaking player reaches here, drop instantly. + } + else + { + mobj->movefactor = 0; + } // Sryder 2018-12-7: Grabbed this from the old MT_BOSS3WAYPOINT section so they'll be in the waypointcap instead P_SetTarget(&mobj->tracer, waypointcap); diff --git a/src/p_spec.h b/src/p_spec.h index af0b8e7fe..f1f611213 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -129,10 +129,11 @@ typedef enum typedef enum { - TMWPF_DISABLED = 1, - TMWPF_SHORTCUT = 1<<1, - TMWPF_NORESPAWN = 1<<2, - TMWPF_FINISHLINE = 1<<3, + TMWPF_DISABLED = 1, + TMWPF_SHORTCUT = 1<<1, + TMWPF_NORESPAWN = 1<<2, + TMWPF_FINISHLINE = 1<<3, + TMWPF_BLOCKLIGHTSNAKE = 1<<4 } textmapwaypointflags_t; typedef enum