Open Guantol-Lemat opened 4 months ago
Thanks for the detailed issue! This is actually working as designed; under the hood, stage API is loading a number of rooms in advance in order to cache room state objects for various features. If you're having an issue with post new room being run multiple times at game start, consider whether the initialization code you're using should run in a different callback, e.g. POST_GAME_STARTED
Thank you for the quick response! In the end my code still ran as intended, even with the additional calls. However, just in case it becomes necessary later on, is there any global variable or procedure that can indicate whether StageAPI is performing this caching operation? This way, it would be possible to "ignore" the additional calls. If not, could one be implemented?
Preamble
The Problem
Whenever the game is booted up and a run is started the MC_POST_NEW_ROOM callback is fired multiple times when it would otherwise fire only a single time. This happens whether or not the run is Continued, however the number of times the callback is fired change (1 additional time if Continued, and 2 additional times for New Runs). This problem does not occur on subsequent New/Continued runs; it only happens the first time a run is started.
Steps to Replicate
Demonstration
https://github.com/Meowlala/BOIStageAPI15/assets/138233404/160b876f-c065-447c-9d21-ceb5183ec91a