Fix indicator lights for active signals across save/load

This commit is contained in:
Matt Penny 2024-04-11 22:44:03 -04:00
parent 9401198969
commit 7005450479
2 changed files with 7 additions and 1 deletions

View File

@ -92,6 +92,12 @@ void sceneInit(struct Scene* scene) {
} else {
scene->checkpointState = SceneCheckpointStateSaved;
checkpointLoadLast(scene);
// Signal materials are only updated on state change, and the loaded
// checkpoint could have active signals. Ensure materials accurately
// reflect the state of such signals, before the first scene update
// overwrites their previous state.
staticRenderCheckSignalMaterials();
}
savefileMarkChapterProgress(gCurrentLevelIndex);

View File

@ -29,7 +29,7 @@ void signalsInit(unsigned signalCount) {
}
void signalsReset() {
int binCount = (gSignalCount + 63) >> 6;
int binCount = SIGNAL_BIN_COUNT(gSignalCount);
for (int i = 0; i < binCount; ++i) {
gPrevSignals[i] = gSignals[i];