Skip to content

Commit 98b1ac5

Browse files
committed
initStageEvents - Apply room fixes at the end of the function instead of the beginning
This is to avoid the possibility of the stage events code overwriting some of the fixes.
1 parent 57e4b62 commit 98b1ac5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ttyd-tools/rel/source/menufunctions.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3698,11 +3698,11 @@ bool getEventDetails(int32_t index, WarpByEventDetailsStruct *warpByEventDetails
36983698

36993699
void *initStageEvents()
37003700
{
3701-
// Check to see if any fixes need to be applied to specific maps
3702-
fixRoomProblems();
3703-
37043701
if (!WarpByEvent.ShouldInit)
37053702
{
3703+
// Check to see if any fixes need to be applied to specific maps
3704+
fixRoomProblems();
3705+
37063706
// The overwritten instruction sets r3 to the global work pointer, so return the global work pointer
37073707
return ttyd::mariost::globalWorkPointer;
37083708
}
@@ -3713,6 +3713,9 @@ void *initStageEvents()
37133713
int32_t CurrentIndex = WarpByEvent.CurrentIndex;
37143714
if (!indexToStageAndEvent(CurrentIndex, StageAndEventIds))
37153715
{
3716+
// Check to see if any fixes need to be applied to specific maps
3717+
fixRoomProblems();
3718+
37163719
// The overwritten instruction sets r3 to the global work pointer, so return the global work pointer
37173720
return ttyd::mariost::globalWorkPointer;
37183721
}
@@ -3722,6 +3725,9 @@ void *initStageEvents()
37223725

37233726
if (!checkForValidStageAndEvent(StageId, EventId))
37243727
{
3728+
// Check to see if any fixes need to be applied to specific maps
3729+
fixRoomProblems();
3730+
37253731
// The overwritten instruction sets r3 to the global work pointer, so return the global work pointer
37263732
return ttyd::mariost::globalWorkPointer;
37273733
}
@@ -3941,6 +3947,9 @@ void *initStageEvents()
39413947
// Override any flags set in this function if the previous flags were locked
39423948
lockFlags();
39433949

3950+
// Check to see if any fixes need to be applied to specific maps
3951+
fixRoomProblems();
3952+
39443953
// The overwritten instruction sets r3 to the global work pointer, so return the global work pointer
39453954
return ttyd::mariost::globalWorkPointer;
39463955
}

0 commit comments

Comments
 (0)