From bdf269c2624842697fd618f3b1e0999dc4191894 Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 11 Aug 2020 23:27:37 -0700 Subject: [PATCH] Fixed tower platform spawning bug --- data/behavior_data.c | 1 + src/game/behavior_actions.h | 1 + src/game/behaviors/tower_platform.inc.c | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/behavior_data.c b/data/behavior_data.c index 9dd7bc61..f1a45a2e 100644 --- a/data/behavior_data.c +++ b/data/behavior_data.c @@ -1724,6 +1724,7 @@ const BehaviorScript bhvTowerPlatformGroup[] = { DISABLE_RENDERING(), ADD_FLOAT(oPosY, 300), SET_HOME(), + CALL_NATIVE(bhv_tower_platform_group_init), BEGIN_LOOP(), CALL_NATIVE(bhv_tower_platform_group_loop), END_LOOP(), diff --git a/src/game/behavior_actions.h b/src/game/behavior_actions.h index 94d5743e..392b309c 100644 --- a/src/game/behavior_actions.h +++ b/src/game/behavior_actions.h @@ -113,6 +113,7 @@ void bhv_black_smoke_bowser_loop(void); void bhv_black_smoke_upward_loop(void); void bhv_beta_fish_splash_spawner_loop(void); void bhv_spindrift_loop(void); +void bhv_tower_platform_group_init(void); void bhv_tower_platform_group_loop(void); void bhv_wf_sliding_tower_platform_loop(void); void bhv_wf_elevator_tower_platform_loop(void); diff --git a/src/game/behaviors/tower_platform.inc.c b/src/game/behaviors/tower_platform.inc.c index 45688b6a..dbba9d27 100644 --- a/src/game/behaviors/tower_platform.inc.c +++ b/src/game/behaviors/tower_platform.inc.c @@ -124,9 +124,11 @@ void spawn_wf_platform_group(void) { spawn_and_init_wf_platforms(MODEL_WF_TOWER_SQUARE_PLATORM_ELEVATOR, bhvWfElevatorTowerPlatform); } +void bhv_tower_platform_group_init(void) { + spawn_wf_platform_group(); +} + void bhv_tower_platform_group_loop(void) { - static u8 spawnedPlatforms = FALSE; - if (!spawnedPlatforms) { spawn_wf_platform_group(); spawnedPlatforms = TRUE; } u8 anyPlayerInRange = FALSE; for (int i = 0; i < MAX_PLAYERS; i++) {