From 1086c1e7990ed4ff3b4c918c68e9ae5f401f31f9 Mon Sep 17 00:00:00 2001 From: Ashnal Date: Wed, 25 Jun 2025 19:07:10 -0400 Subject: [PATCH] Bailquake Cleanup --- src/d_player.h | 2 +- src/k_kart.c | 20 +++++--------------- src/lua_playerlib.c | 4 ++-- src/p_spec.c | 4 +--- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index b35a60835..2fd34d7f6 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -1083,7 +1083,7 @@ struct player_t UINT32 bailcharge; UINT32 baildrop; - UINT8 bailquake; + boolean bailquake; boolean analoginput; // Has an input been recorded that requires analog usage? For input display. diff --git a/src/k_kart.c b/src/k_kart.c index 1ae47cc90..b13d383ee 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10051,16 +10051,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->ringboost /= 3; } - if (player->bailquake) - player->bailquake--; - - // bail camera shake - if (player->bailquake > 0 && !player->mo->hitlag) // only start after hitlag ends + if (player->bailquake) // quake as soon as we leave hitlag { - P_StartQuakeFromMobj(1, 50 * player->mo->scale, 2048 * player->mo->scale, player->mo); - } - - + P_StartQuakeFromMobj(7, 50 * player->mo->scale, 2048 * player->mo->scale, player->mo); + player->bailquake = false; + } // The precise ordering of start-of-level made me want to cut my head off, // so let's try this instead. Whatever! @@ -14044,12 +14039,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->baildrop = baildrop * BAIL_DROPFREQUENCY + 1; K_AddHitLag(player->mo, TICRATE/4, false); - player->bailquake = player->mo->hitlag; // the quake effect that uses this will ignore it during hitlag and trigger after, so it needs to be longer than the hitlag - - //if (player->mo->hitlag > 0) // bail blink; make the player invisible during the swish, like classic games. - //{ - //player->mo->renderflags |= RF_DONTDRAW; - //} + player->bailquake = true; // set for a one time quake effect as soon as hitlag ends if (P_PlayerInPain(player)) { diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index ffbd731e6..0b0e541bd 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -289,7 +289,7 @@ static int player_get(lua_State *L) else if (fastcmp(field,"baildrop")) lua_pushinteger(L, plr->baildrop); else if (fastcmp(field,"bailquake")) - lua_pushinteger(L, plr->bailquake); + lua_pushboolean(L, plr->bailquake); else if (fastcmp(field,"dotrickfx")) lua_pushboolean(L, plr->dotrickfx); else if (fastcmp(field,"stingfx")) @@ -921,7 +921,7 @@ static int player_set(lua_State *L) else if (fastcmp(field,"baildrop")) plr->baildrop = luaL_checkinteger(L, 3); else if (fastcmp(field,"bailquake")) - plr->bailquake = luaL_checkinteger(L, 3); + plr->bailquake = luaL_checkboolean(L, 3); else if (fastcmp(field,"analoginput")) plr->analoginput = luaL_checkboolean(L, 3); else if (fastcmp(field,"transfer")) diff --git a/src/p_spec.c b/src/p_spec.c index 4f7606aaa..36e6531b7 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -9635,7 +9635,7 @@ void P_DoQuakeOffset(UINT8 view, mappoint_t *viewPos, mappoint_t *offset) quake = quake->next; } - // Add level-based effects, and local bailquake + // Add level-based effects if (P_MobjWasRemoved(viewer->mo) == false && viewer->speed > viewer->mo->scale && P_IsObjectOnGround(viewer->mo) == true) @@ -9653,8 +9653,6 @@ void P_DoQuakeOffset(UINT8 view, mappoint_t *viewPos, mappoint_t *offset) ir = FixedMul((viewer->stairjank * FRACUNIT * 5) / 17, mapobjectscale); addZ += ir; } - - } fixed_t maxShake = FixedMul(cv_cam_height[view].value, mapobjectscale) * 3 / 4;