Fixed tower platform spawning bug

This commit is contained in:
MysterD 2020-08-11 23:27:37 -07:00
parent 55df4e6bd7
commit bdf269c262
3 changed files with 6 additions and 2 deletions

View File

@ -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(),

View File

@ -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);

View File

@ -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++) {