From de5da9a5f23853fb6b8c3c842e24363d7c775354 Mon Sep 17 00:00:00 2001 From: En Yi Date: Sat, 18 Nov 2023 20:12:39 +0800 Subject: [PATCH] Increase lifetime for bomb crates --- scenes/game_systems.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/scenes/game_systems.c b/scenes/game_systems.c index 86058fc..1d7031f 100644 --- a/scenes/game_systems.c +++ b/scenes/game_systems.c @@ -1623,9 +1623,7 @@ void hitbox_update_system(Scene_t* scene) CBBox_t* p_bbox = get_component(p_ent, CBBOX_COMP_T); CPlayerState_t* p_pstate = get_component(p_ent, CPLAYERSTATE_T); - if ( - p_pstate != NULL - ) + if (p_pstate != NULL) { if (p_ctransform->position.y + p_bbox->size.y <= p_other_ct->position.y) { @@ -1660,7 +1658,22 @@ void hitbox_update_system(Scene_t* scene) { remove_component(p_other_ent, CHURTBOX_T); CLifeTimer_t* p_clifetimer = add_component(p_other_ent, CLIFETIMER_T); - p_clifetimer->life_time = 3; + if (p_other_ent->m_tag == CRATES_ENT_TAG) + { + CContainer_t* p_container = get_component(p_other_ent, CCONTAINER_T); + if (p_container->item == CONTAINER_BOMB) + { + p_clifetimer->life_time = 6; + } + else + { + p_clifetimer->life_time = 3; + } + } + else + { + p_clifetimer->life_time = 3; + } } } else