From b54a53b9c81844359b02af6d9f7bcf604c5ef38c Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 5 Mar 2026 17:24:20 +0000 Subject: [PATCH] Fix jetpack use resetting recharge --- src/game/player.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/game/player.c b/src/game/player.c index 53ae4fb..7b7b817 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -301,8 +301,11 @@ void player_update(Entity *self, float dt, const Tilemap *map) { if (input_pressed(ACTION_DASH) && pd->dash_charges > 0) { pd->dash_charges--; - pd->dash_recharge_timer = (pd->jetpack_boost_timer > 0) - ? PLAYER_JETPACK_BOOST_RECHARGE : PLAYER_DASH_RECHARGE; + /* Start recharge timer only if not already recharging */ + if (pd->dash_recharge_timer <= 0) { + pd->dash_recharge_timer = (pd->jetpack_boost_timer > 0) + ? PLAYER_JETPACK_BOOST_RECHARGE : PLAYER_DASH_RECHARGE; + } pd->dash_timer = PLAYER_DASH_DURATION; /* Determine dash direction from input */