Fix jetpack use resetting recharge

This commit is contained in:
Thomas
2026-03-05 17:24:20 +00:00
parent 27691a28dd
commit b54a53b9c8

View File

@@ -301,8 +301,11 @@ void player_update(Entity *self, float dt, const Tilemap *map) {
if (input_pressed(ACTION_DASH) && pd->dash_charges > 0) { if (input_pressed(ACTION_DASH) && pd->dash_charges > 0) {
pd->dash_charges--; pd->dash_charges--;
/* Start recharge timer only if not already recharging */
if (pd->dash_recharge_timer <= 0) {
pd->dash_recharge_timer = (pd->jetpack_boost_timer > 0) pd->dash_recharge_timer = (pd->jetpack_boost_timer > 0)
? PLAYER_JETPACK_BOOST_RECHARGE : PLAYER_DASH_RECHARGE; ? PLAYER_JETPACK_BOOST_RECHARGE : PLAYER_DASH_RECHARGE;
}
pd->dash_timer = PLAYER_DASH_DURATION; pd->dash_timer = PLAYER_DASH_DURATION;
/* Determine dash direction from input */ /* Determine dash direction from input */