Give bots thier own non localangle dependent turning code
This commit is contained in:
parent
90481e0167
commit
23ca6b1326
1 changed files with 33 additions and 1 deletions
34
src/p_user.c
34
src/p_user.c
|
|
@ -2064,6 +2064,35 @@ static void P_UpdatePlayerAngle(player_t *player)
|
|||
}
|
||||
}
|
||||
|
||||
static void P_UpdateBotAngle(player_t* player)
|
||||
{
|
||||
angle_t angleChange = K_GetKartTurnValue(player, player->cmd.turning) << TICCMD_REDUCE;
|
||||
player->steering = player->cmd.turning;
|
||||
UINT8 i;
|
||||
|
||||
P_SetPlayerAngle(player, player->angleturn + angleChange);
|
||||
player->mo->angle = player->angleturn;
|
||||
|
||||
if (!cv_allowmlook.value || player->spectator == false)
|
||||
{
|
||||
player->aiming = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->aiming += (player->cmd.aiming << TICCMD_REDUCE);
|
||||
player->aiming = G_ClipAimingPitch((INT32*) &player->aiming);
|
||||
}
|
||||
|
||||
for (i = 0; i <= r_splitscreen; i++)
|
||||
{
|
||||
if (player == &players[displayplayers[i]])
|
||||
{
|
||||
localaiming[i] = player->aiming;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// P_SpectatorMovement
|
||||
//
|
||||
|
|
@ -2136,7 +2165,10 @@ void P_MovePlayer(player_t *player)
|
|||
// MOVEMENT CODE //
|
||||
//////////////////////
|
||||
|
||||
P_UpdatePlayerAngle(player);
|
||||
if (K_PlayerUsesBotMovement(player))
|
||||
P_UpdateBotAngle(player);
|
||||
else
|
||||
P_UpdatePlayerAngle(player);
|
||||
|
||||
ticruned++;
|
||||
if (!(cmd->flags & TICCMD_RECEIVED))
|
||||
|
|
|
|||
Loading…
Reference in a new issue