From eae8e1516bd16b40e9f598ccabebff198b824c86 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Tue, 13 May 2025 20:23:54 -0400 Subject: [PATCH] Move bumpslow to botvars --- src/d_player.h | 3 +-- src/k_bot.cpp | 2 +- src/k_kart.c | 6 +++--- src/lua_playerlib.c | 4 ---- src/p_saveg.cpp | 6 ++---- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index babfa6a86..2c0979103 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -406,6 +406,7 @@ struct botvars_t // All entries above persist between rounds and must be recorded in demos fixed_t rubberband; // Bot rubberband value + UINT8 bumpslow; tic_t itemdelay; // Delay before using item at all tic_t itemconfirm; // When high enough, they will use their item @@ -844,8 +845,6 @@ struct player_t UINT8 trickboost; // Trick boost. This one is weird and has variable speed. Dear god. UINT8 tricklock; // Input safety for 2.2 lenient tricks. - UINT8 bumpslow; - UINT8 dashRingPullTics; // Timer during which the player is pulled towards a dash ring UINT8 dashRingPushTics; // Timer during which the player displays effects and has no gravity after being thrust by a dash ring diff --git a/src/k_bot.cpp b/src/k_bot.cpp index 3875c56ab..041a0be38 100644 --- a/src/k_bot.cpp +++ b/src/k_bot.cpp @@ -805,7 +805,7 @@ fixed_t K_UpdateRubberband(player_t *player) UINT8 ease_soften = 8; - if (player->bumpslow && dest > ret) + if (player->botvars.bumpslow && dest > ret) ease_soften *= 10; // Ease into the new value. diff --git a/src/k_kart.c b/src/k_kart.c index 22e7bc2d2..6d6ac23fc 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9438,8 +9438,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->trickboost) player->trickboost--; - if (player->bumpslow && player->incontrol) - player->bumpslow--; + if (K_PlayerUsesBotMovement(players) && player->botvars.bumpslow && player->incontrol) + player->botvars.bumpslow--; if (player->flamedash) { @@ -15457,7 +15457,7 @@ void K_BotHitPenalty(player_t *player) if (K_PlayerUsesBotMovement(player)) { player->botvars.rubberband = max(player->botvars.rubberband/2, FRACUNIT/2); - player->bumpslow = TICRATE*2; + player->botvars.bumpslow = TICRATE*2; } } diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 4833edfa5..62eca4611 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -526,8 +526,6 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->trickboost); else if (fastcmp(field,"tricklock")) lua_pushinteger(L, plr->tricklock); - else if (fastcmp(field,"bumpslow")) - lua_pushinteger(L, plr->bumpslow); else if (fastcmp(field,"dashringpulltics")) lua_pushinteger(L, plr->dashRingPullTics); else if (fastcmp(field,"dashringpushtics")) @@ -1138,8 +1136,6 @@ static int player_set(lua_State *L) plr->trickboost = luaL_checkinteger(L, 3); else if (fastcmp(field,"tricklock")) plr->tricklock = luaL_checkinteger(L, 3); - else if (fastcmp(field,"bumpslow")) - plr->bumpslow = luaL_checkinteger(L, 3); else if (fastcmp(field,"dashringpulltics")) plr->dashRingPullTics = luaL_checkinteger(L, 3); else if (fastcmp(field,"dashringpushtics")) diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index b3072b409..3723417c6 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -569,8 +569,6 @@ static void P_NetArchivePlayers(savebuffer_t *save) WRITEUINT8(save->p, players[i].trickboost); WRITEUINT8(save->p, players[i].tricklock); - WRITEUINT8(save->p, players[i].bumpslow); - WRITEUINT8(save->p, players[i].dashRingPullTics); WRITEUINT8(save->p, players[i].dashRingPushTics); @@ -733,6 +731,7 @@ static void P_NetArchivePlayers(savebuffer_t *save) WRITEUINT8(save->p, players[i].botvars.diffincrease); WRITEUINT8(save->p, players[i].botvars.rival); WRITEFIXED(save->p, players[i].botvars.rubberband); + WRITEUINT8(save->p, players[i].botvars.bumpslow); WRITEUINT32(save->p, players[i].botvars.itemdelay); WRITEUINT32(save->p, players[i].botvars.itemconfirm); WRITESINT8(save->p, players[i].botvars.turnconfirm); @@ -1208,8 +1207,6 @@ static void P_NetUnArchivePlayers(savebuffer_t *save) players[i].trickboost = READUINT8(save->p); players[i].tricklock = READUINT8(save->p); - players[i].bumpslow = READUINT8(save->p); - players[i].dashRingPullTics = READUINT8(save->p); players[i].dashRingPushTics = READUINT8(save->p); @@ -1372,6 +1369,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save) players[i].botvars.diffincrease = READUINT8(save->p); players[i].botvars.rival = (boolean)READUINT8(save->p); players[i].botvars.rubberband = READFIXED(save->p); + players[i].botvars.bumpslow = READUINT8(save->p); players[i].botvars.itemdelay = READUINT32(save->p); players[i].botvars.itemconfirm = READUINT32(save->p); players[i].botvars.turnconfirm = READSINT8(save->p);