mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Small optimize
Only calulate scam percentage once during think for 1x mult, use multiple times
This commit is contained in:
parent
c316924792
commit
5a17e54ebe
1 changed files with 3 additions and 2 deletions
|
|
@ -9711,6 +9711,7 @@ boolean K_PressingEBrake(const player_t *player)
|
|||
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||
{
|
||||
const boolean onground = P_IsObjectOnGround(player->mo);
|
||||
const fixed_t scamming = K_PlayerScamPercentage(player, 1);
|
||||
|
||||
/* reset sprite offsets :) */
|
||||
player->mo->sprxoff = 0;
|
||||
|
|
@ -10582,7 +10583,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->invincibilitytimer && (player->ignoreAirtimeLeniency > 0 || onground == true || K_PowerUpRemaining(player, POWERUP_SMONITOR)))
|
||||
{
|
||||
player->invincibilitytimer--;
|
||||
if (player->invincibilitytimer && K_PlayerScamPercentage(player, 1))
|
||||
if (player->invincibilitytimer && scamming)
|
||||
player->invincibilitytimer--;
|
||||
|
||||
// Extra tripwire leniency for the end of invincibility
|
||||
|
|
@ -10801,7 +10802,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->growshrinktimer > 0 && (onground == true || player->ignoreAirtimeLeniency > 0))
|
||||
{
|
||||
player->growshrinktimer--;
|
||||
if (player->growshrinktimer && K_PlayerScamPercentage(player, 1))
|
||||
if (player->growshrinktimer && scamming)
|
||||
player->growshrinktimer--;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue