From 1ab2b4a897b6c6c3c05e391672c0fb51bc89dec8 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 10 Oct 2022 10:26:25 -0400 Subject: [PATCH] Bot Controller uses args --- src/k_bot.c | 12 ++++++------ src/p_setup.c | 11 +++++++++++ src/p_spec.h | 7 +++++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/k_bot.c b/src/k_bot.c index 30c661704..eb94d46be 100644 --- a/src/k_bot.c +++ b/src/k_bot.c @@ -510,8 +510,8 @@ fixed_t K_BotRubberband(player_t *player) if (botController != NULL) { - // No Climb Flag: Disable rubberbanding - if (botController->flags & ML_NOCLIMB) + // Disable rubberbanding + if (botController->args[1] & TMBOT_NORUBBERBAND) { return FRACUNIT; } @@ -931,7 +931,7 @@ static void K_BotTrick(player_t *player, ticcmd_t *cmd, line_t *botController) if (player->trickpanel == 1) { - INT32 type = (sides[botController->sidenum[0]].rowoffset / FRACUNIT); + INT32 type = botController->args[0]; // Y Offset: Trick type switch (type) @@ -1318,7 +1318,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd) return; } - if (botController != NULL && (botController->flags & ML_NOSKEW)) // FIXME: UDMF-ify + if (botController != NULL && (botController->args[1] & TMBOT_NOCONTROL)) // FIXME: UDMF-ify { // Disable bot controls entirely. return; @@ -1326,12 +1326,12 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd) destangle = player->mo->angle; - if (botController != NULL && (botController->flags & ML_SKEWTD)) // FIXME: UDMF-ify + if (botController != NULL && (botController->args[1] & TMBOT_FORCEDIR)) // FIXME: UDMF-ify { const fixed_t dist = DEFAULT_WAYPOINT_RADIUS * player->mo->scale; // X Offset: Movement direction - destangle = FixedAngle(sides[botController->sidenum[0]].textureoffset); + destangle = FixedAngle(botController->args[2] * FRACUNIT); // Overwritten prediction predict = Z_Calloc(sizeof(botprediction_t), PU_STATIC, NULL); diff --git a/src/p_setup.c b/src/p_setup.c index 8b2cf2127..c4c75582a 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -5785,6 +5785,17 @@ static void P_ConvertBinaryLinedefTypes(void) if (lines[i].flags & ML_NOCLIMB) lines[i].args[0] |= TMCRF_FRONTONLY; break; + case 2004: //Bot controller + botController->args[0] = sides[botController->sidenum[0]].rowoffset / FRACUNIT; + + if (lines[i].flags & ML_NOCLIMB) + lines[i].args[1] |= TMBOT_NORUBBERBAND; + if (lines[i].flags & ML_NOSKEW) + lines[i].args[1] |= TMBOT_NOCONTROL; + if (lines[i].flags & ML_SKEWTD) + lines[i].args[1] |= TMBOT_FORCEDIR; + + botController->args[2] = sides[botController->sidenum[0]].textureoffset / FRACUNIT; default: break; } diff --git a/src/p_spec.h b/src/p_spec.h index ac501d056..41b9315b8 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -494,6 +494,13 @@ typedef enum TMCRF_FRONTONLY = 1, } textmapcrossrespawnflags_t; +typedef enum +{ + TMBOT_NORUBBERBAND = 1, + TMBOT_NOCONTROL = 1<<1, + TMBOT_FORCEDIR = 1<<2, +} textmapbotcontroller_t; + // GETSECSPECIAL (specialval, section) // // Pulls out the special # from a particular section.