mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-21 18:32:08 +00:00
Mixed code...
This commit is contained in:
parent
eefc285b5c
commit
1febf8cb4b
1 changed files with 6 additions and 4 deletions
10
src/b_bot.c
10
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;
|
||||
|
|
Loading…
Reference in a new issue