@@ -28,27 +28,34 @@ void Mod::reloadScreen()
28
28
29
29
if ((NextSeq >= Game) && (NextSeq <= MapChange))
30
30
{
31
- // Not in the pause menu
32
- // A separate address for NextBero is needed, as the original value will be cleared during the reloading process
33
- // The game will crash if NextMap is used directly in seqSetSeq, so a separate address must be used instead
31
+ uint32_t Seq = ttyd::seqdrv::seqGetSeq ();
32
+ uint32_t Battle = static_cast <uint32_t >(ttyd::seqdrv::SeqIndex::kBattle );
34
33
35
- ttyd::string::strcpy (NewBero, NextBero);
36
- ttyd::string::strcpy (NewMap, NextMap);
37
- ttyd::seqdrv::seqSetSeq (ttyd::seqdrv::SeqIndex::kMapChange , NewMap, NewBero);
38
-
39
- uint32_t SystemLevel = ttyd::mariost::marioStGetSystemLevel ();
40
- if (SystemLevel != 0 )
34
+ // Reloading the room with the Seq set to Battle will cause the game to crash, so don't allow it
35
+ if (Seq != Battle)
41
36
{
42
- if (SystemLevel == 15 )
37
+ // Not in the pause menu
38
+ // A separate address for NextBero is needed, as the original value will be cleared during the reloading process
39
+ // The game will crash if NextMap is used directly in seqSetSeq, so a separate address must be used instead
40
+
41
+ ttyd::string::strcpy (NewBero, NextBero);
42
+ ttyd::string::strcpy (NewMap, NextMap);
43
+ ttyd::seqdrv::seqSetSeq (ttyd::seqdrv::SeqIndex::kMapChange , NewMap, NewBero);
44
+
45
+ uint32_t SystemLevel = ttyd::mariost::marioStGetSystemLevel ();
46
+ if (SystemLevel != 0 )
43
47
{
44
- // Currently in pause menu, so re-enable the camera
45
- ttyd::camdrv::camDispOn (4 );
48
+ if (SystemLevel == 15 )
49
+ {
50
+ // Currently in pause menu, so re-enable the camera
51
+ ttyd::camdrv::camDispOn (4 );
52
+ }
53
+
54
+ // Enable sound effects, set the default camera id for Mario, and give back control to the player
55
+ ttyd::pmario_sound::psndClearFlag (0x80 );
56
+ ttyd::mario_cam::marioSetCamId (4 );
57
+ ttyd::mariost::marioStSystemLevel (0 );
46
58
}
47
-
48
- // Enable sound effects, set the default camera id for Mario, and give back control to the player
49
- ttyd::pmario_sound::psndClearFlag (0x80 );
50
- ttyd::mario_cam::marioSetCamId (4 );
51
- ttyd::mariost::marioStSystemLevel (0 );
52
59
}
53
60
}
54
61
}
0 commit comments