From 7a4cf55c06720983078e5fb4234d20e76b9ad579 Mon Sep 17 00:00:00 2001 From: En Yi Date: Sun, 13 Apr 2025 20:30:28 +0800 Subject: [PATCH] Allow only binary short hop on crates --- scenes/game_systems.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scenes/game_systems.c b/scenes/game_systems.c index 3559fa4..980237b 100644 --- a/scenes/game_systems.c +++ b/scenes/game_systems.c @@ -1710,13 +1710,15 @@ void hitbox_update_system(Scene_t* scene) { if (p_ent->position.y + p_bbox->size.y <= p_other_ent->position.y) { + CJump_t * p_cjump = get_component(p_ent, CJUMP_COMP_T); + // Don't allow the usual jump interaction with crate jump + p_cjump->short_hop = true; + p_cjump->jumped = false; + p_ctransform->velocity.y = -400; if (p_pstate->jump_pressed) { p_ctransform->velocity.y = -600; - CJump_t * p_cjump = get_component(p_ent, CJUMP_COMP_T); - p_cjump->short_hop = false; - p_cjump->jumped = true; } if (p_ent->m_tag == PLAYER_ENT_TAG) {