mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-17 10:11:12 +00:00
Fix really weird crash I should've checked for
Make the returning of top kart speed slightly cleaner
This commit is contained in:
parent
c6814943ec
commit
1ac0f8c5a8
2 changed files with 9 additions and 4 deletions
|
@ -1273,7 +1273,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
||||||
else if (cmd->angleturn < -angleturn[1])
|
else if (cmd->angleturn < -angleturn[1])
|
||||||
cmd->angleturn = -angleturn[1];
|
cmd->angleturn = -angleturn[1];
|
||||||
|
|
||||||
cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn);
|
if (player->mo)
|
||||||
|
cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn);
|
||||||
|
|
||||||
// SRB2kart - no additional angle if not moving
|
// SRB2kart - no additional angle if not moving
|
||||||
if ((player->mo && player->speed > 0) || (leveltime > 140 && (cmd->buttons & BT_ACCELERATE) && (cmd->buttons & BT_BRAKE)))
|
if ((player->mo && player->speed > 0) || (leveltime > 140 && (cmd->buttons & BT_ACCELERATE) && (cmd->buttons & BT_BRAKE)))
|
||||||
|
@ -1617,7 +1618,8 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
|
||||||
else if (cmd->angleturn < -angleturn[1])
|
else if (cmd->angleturn < -angleturn[1])
|
||||||
cmd->angleturn = -angleturn[1];
|
cmd->angleturn = -angleturn[1];
|
||||||
|
|
||||||
cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn);
|
if (player->mo)
|
||||||
|
cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn);
|
||||||
|
|
||||||
// SRB2kart - no additional angle if not moving
|
// SRB2kart - no additional angle if not moving
|
||||||
if ((player->mo && player->speed > 0) || (leveltime > 140 && (cmd->buttons & BT_ACCELERATE) && (cmd->buttons & BT_BRAKE)))
|
if ((player->mo && player->speed > 0) || (leveltime > 140 && (cmd->buttons & BT_ACCELERATE) && (cmd->buttons & BT_BRAKE)))
|
||||||
|
|
|
@ -1077,6 +1077,7 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
|
||||||
fixed_t k_speed = 150;
|
fixed_t k_speed = 150;
|
||||||
fixed_t g_cc = FRACUNIT;
|
fixed_t g_cc = FRACUNIT;
|
||||||
fixed_t xspd = 3072; // 4.6875 aka 3/64
|
fixed_t xspd = 3072; // 4.6875 aka 3/64
|
||||||
|
fixed_t finalspeed;
|
||||||
|
|
||||||
switch (cv_kartcc.value)
|
switch (cv_kartcc.value)
|
||||||
{
|
{
|
||||||
|
@ -1093,9 +1094,11 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
|
||||||
|
|
||||||
k_speed += player->kartspeed*3; // 153 - 177
|
k_speed += player->kartspeed*3; // 153 - 177
|
||||||
|
|
||||||
|
finalspeed = FixedMul(FixedMul(k_speed<<14, g_cc), player->mo->scale);
|
||||||
|
|
||||||
if (doboostpower)
|
if (doboostpower)
|
||||||
return FixedMul(FixedMul(FixedMul(k_speed<<14, g_cc), K_GetKartBoostPower(player, true)), player->mo->scale);
|
return FixedMul(finalspeed, K_GetKartBoostPower(player, true));
|
||||||
return FixedMul(FixedMul(k_speed<<14, g_cc), player->mo->scale);
|
return finalspeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static fixed_t K_GetKartAccel(player_t *player)
|
static fixed_t K_GetKartAccel(player_t *player)
|
||||||
|
|
Loading…
Reference in a new issue