Fix jetpack use resetting recharge
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user