Properly use bot movement when exiting

This commit is contained in:
Sally Cochenour 2020-03-29 17:59:26 -04:00
parent 2e4b1c6ecb
commit 0ef12d3cce
2 changed files with 9 additions and 9 deletions

View file

@ -2674,6 +2674,9 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove
// 0 with no gas, and // 0 with no gas, and
// -25 when only braking. // -25 when only braking.
if (EITHERSNEAKER(player))
forwardmove = 50;
finalspeed *= forwardmove/25; finalspeed *= forwardmove/25;
finalspeed /= 2; finalspeed /= 2;
@ -5459,7 +5462,7 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd)
class = s+(3*w); class = s+(3*w);
// Silence the engines // Silence the engines
if (leveltime < 8 || player->spectator || player->exiting) if (leveltime < 8 || player->spectator)
{ {
player->karthud[khud_enginesnd] = 0; // Reset sound number player->karthud[khud_enginesnd] = 0; // Reset sound number
return; return;
@ -6184,7 +6187,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->kartstuff[k_bubblecool] = 0; player->kartstuff[k_bubblecool] = 0;
} }
if (player->kartstuff[k_itemtype] != KITEM_FLAMESHIELD || player->exiting) if (player->kartstuff[k_itemtype] != KITEM_FLAMESHIELD)
{ {
if (player->kartstuff[k_flamedash]) if (player->kartstuff[k_flamedash])
K_FlameDashLeftoverSmoke(player->mo); K_FlameDashLeftoverSmoke(player->mo);
@ -6403,8 +6406,7 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
} }
} }
if ((waypoint->prevwaypoints != NULL) && (waypoint->numprevwaypoints > 0U) if ((waypoint->prevwaypoints != NULL) && (waypoint->numprevwaypoints > 0U))
&& !K_PlayerUsesBotMovement(player))
{ {
for (i = 0U; i < waypoint->numprevwaypoints; i++) for (i = 0U; i < waypoint->numprevwaypoints; i++)
{ {
@ -6572,7 +6574,7 @@ static void K_UpdateDistanceFromFinishLine(player_t *const player)
// nextwaypoint is now the waypoint that is in front of us // nextwaypoint is now the waypoint that is in front of us
if (player->exiting) if (player->exiting)
{ {
// Player has finished, we don't need to calculate distance // Player has finished, we don't need to calculate this
player->distancetofinish = 0U; player->distancetofinish = 0U;
} }
else if ((player->nextwaypoint != NULL) && (finishline != NULL)) else if ((player->nextwaypoint != NULL) && (finishline != NULL))
@ -7141,7 +7143,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
else if (cmd->buttons & BT_ATTACK) else if (cmd->buttons & BT_ATTACK)
player->pflags |= PF_ATTACKDOWN; player->pflags |= PF_ATTACKDOWN;
if (player && player->mo && player->mo->health > 0 && !player->spectator && !(player->exiting || mapreset) && leveltime > starttime if (player && player->mo && player->mo->health > 0 && !player->spectator && !mapreset && leveltime > starttime
&& player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_squishedtimer] == 0 && player->kartstuff[k_respawn] == 0) && player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_squishedtimer] == 0 && player->kartstuff[k_respawn] == 0)
{ {
// First, the really specific, finicky items that function without the item being directly in your item slot. // First, the really specific, finicky items that function without the item being directly in your item slot.

View file

@ -3993,11 +3993,9 @@ static void P_3dMovement(player_t *player)
cmd = &player->cmd; cmd = &player->cmd;
if ((player->exiting || mapreset) || player->pflags & PF_STASIS || player->kartstuff[k_spinouttimer]) // pw_introcam? if (player->pflags & PF_STASIS || player->kartstuff[k_spinouttimer]) // pw_introcam?
{ {
cmd->forwardmove = cmd->sidemove = 0; cmd->forwardmove = cmd->sidemove = 0;
if (EITHERSNEAKER(player))
cmd->forwardmove = 50;
} }
if (!(player->pflags & PF_FORCESTRAFE) && !player->kartstuff[k_pogospring]) if (!(player->pflags & PF_FORCESTRAFE) && !player->kartstuff[k_pogospring])