From 95a3af6a1a41f2e638fa1e8f14875b4af4114133 Mon Sep 17 00:00:00 2001 From: GenericHeroGuy Date: Sun, 28 Dec 2025 23:26:47 +0100 Subject: [PATCH] Fix missing spinout animation on the fan sector in Diamond Square Also, carry is not a bitfield lol --- src/lua_playerlib.c | 8 ++++---- src/p_enemy.c | 2 +- src/p_user.c | 8 +++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 471ffd1cd..20d9c8020 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -971,7 +971,7 @@ static int player_get(lua_State *L) { UINT32 pflags = plr->pflags; - if (lua_compatmode && (plr->carry & CR_SLIDING) == CR_SLIDING) + if (lua_compatmode && plr->carry == CR_SLIDING) pflags |= PF_SLIDING; if (lua_compatmode && (plr->oldcmd.buttons & BT_ATTACK)) @@ -1303,9 +1303,9 @@ static int player_set(lua_State *L) if (lua_compatmode) { if (pflags & PF_SLIDING) - plr->carry |= CR_SLIDING; - else - plr->carry &= ~CR_SLIDING; + plr->carry = CR_SLIDING; + else if (plr->carry == CR_SLIDING) + plr->carry = CR_NONE; if (pflags & PF_ATTACKDOWN) plr->oldcmd.buttons |= BT_ATTACK; diff --git a/src/p_enemy.c b/src/p_enemy.c index 233469e6e..145fe458c 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -11095,7 +11095,7 @@ void A_SPBChase(void *thing) wspeed = (3*defspeed)/2; if (wspeed < 20*actor->tracer->scale) wspeed = 20*actor->tracer->scale; - if (actor->tracer->player->carry & CR_SLIDING) + if (actor->tracer->player->carry == CR_SLIDING) wspeed = actor->tracer->player->speed/2; // ^^^^ current section: These are annoying, and grand metropolis in particular needs this. diff --git a/src/p_user.c b/src/p_user.c index eb1997e52..a5b61fe45 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -484,7 +484,9 @@ void P_ResetPlayer(player_t *player) { //player->pflags &= ~(PF_); - player->carry = CR_NONE; + // turns out PF_SLIDING is NOT reset by this function! + if (mapnamespace != MNS_SRB2KART || player->carry != CR_SLIDING) + player->carry = CR_NONE; player->onconveyor = 0; player->glanceDir = 0; @@ -1932,7 +1934,7 @@ static void P_3dMovement(player_t *player) } // When sliding, don't allow forward/back - if (player->carry & CR_SLIDING) + if (player->carry == CR_SLIDING) cmd->forwardmove = 0; // Do not let the player control movement if not onground. @@ -4341,7 +4343,7 @@ void P_PlayerThink(player_t *player) // for a bit after a teleport. player->mo->reactiontime--; } - else if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT) + else if (player->carry == CR_ZOOMTUBE && player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT) { P_DoZoomTube(player); player->rmomx = player->rmomy = 0;