fix comment about 0xFFFF usage

This commit is contained in:
Dragorn421 2025-06-11 23:07:20 +02:00
parent fc4e828e68
commit 4e495c44fb
No known key found for this signature in database
GPG Key ID: 381AEBAF3D429335
2 changed files with 7 additions and 6 deletions

View File

@ -425,12 +425,7 @@ typedef enum LinkAge {
// (except for the value 0xFFFD, which is special-cased to do nothing in `Play_Init`).
// It loads layer 4 for 0xFFF0, layer 5 for 0xFFF1, and so on.
//
// The cutsceneIndex could also be set to one of these values to start a
// scripted cutscene immediately. In the vanilla game, this is used to play
// the cutscene where the barrier in Ganon's Castle is dispelled (using index 0xFFFF)
// and to preview cutscenes in debug mode (using index 0xFFFD).
//
// 0xFFFD also is used by the cutscene system to indicate a scripted cutscene has been triggered.
// 0xFFFD is used by the cutscene system to indicate a scripted cutscene has been triggered.
// This is why `Play_Init` ignores that value, so that if the cutscene is interrupted
// by a new play state load (e.g. if the player falls out of bounds), it does not then
// try to wrongly load a cutscene layer.

View File

@ -1391,9 +1391,15 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti
play->csCtx.script = SEGMENTED_TO_VIRTUAL(gTowerBarrierCs);
play->csCtx.curFrame = 0;
gSaveContext.cutsceneTrigger = 1;
// Force cutsceneIndex to CS_INDEX_F so that CS_STATE_STOP is handled by the "scripted" system's
// CutsceneHandler_StopScript.
// Otherwise, because cutsceneIndex is set to 0 above, CS_STATE_STOP would be handled by the
// "manual" cutscene system's CutsceneHandler_StopManual, which does not terminate the cutscene
// camera, resulting in a softlock.
gSaveContext.save.cutsceneIndex = CS_INDEX_F;
csCtx->state = CS_STATE_STOP;
} else {
// Same as above
gSaveContext.save.cutsceneIndex = CS_INDEX_F;
csCtx->state = CS_STATE_STOP;
}