From 1febf8cb4b67108b85b8fad4e20ffe24e5d8d541 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 18 Nov 2019 15:52:14 -0800 Subject: [PATCH] Mixed code... --- src/b_bot.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index badc36b27..0b3d08168 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -445,10 +445,12 @@ void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward // cap inputs so the bot can't accelerate faster diagonally angle = R_PointToAngle2(0, 0, cmd->sidemove << FRACBITS, cmd->forwardmove << FRACBITS); - INT32 maxforward = abs(P_ReturnThrustY(NULL, angle, MAXPLMOVE)); - INT32 maxside = abs(P_ReturnThrustX(NULL, angle, MAXPLMOVE)); - cmd->forwardmove = max(min(cmd->forwardmove, maxforward), -maxforward); - cmd->sidemove = max(min(cmd->sidemove, maxside), -maxside); + { + INT32 maxforward = abs(P_ReturnThrustY(NULL, angle, MAXPLMOVE)); + INT32 maxside = abs(P_ReturnThrustX(NULL, angle, MAXPLMOVE)); + cmd->forwardmove = max(min(cmd->forwardmove, maxforward), -maxforward); + cmd->sidemove = max(min(cmd->sidemove, maxside), -maxside); + } } if (jump) cmd->buttons |= BT_JUMP;