From 48a8b8b817d3c3d4488bf018ccd95f8d1c8b4ea2 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 11 Jun 2022 05:27:17 -0700 Subject: [PATCH] Fix overflow check --- src/k_kart.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 49b41c449..7c8628176 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3451,11 +3451,9 @@ void K_AwardPlayerRings(player_t *player, INT32 rings, boolean overload) superring = player->superring + (rings * 3); - /* overflow */ - if (superring < player->superring) - superring += (player->superring - superring); - - player->superring = superring; + /* check if not overflow */ + if (superring > player->superring) + player->superring = superring; } void K_DoInstashield(player_t *player)