Skip to content

Commit

Permalink
Fixed Crash: Removed Amy AI Casinopolis, changed Back ring for Gamma …
Browse files Browse the repository at this point in the history
…stage, removed last story flag
  • Loading branch information
Sora-yx committed Oct 25, 2021
1 parent e629e52 commit 708ebe3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 39 deletions.
2 changes: 1 addition & 1 deletion sadx-randomizer/05_RedMountain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void RedMountain_Layout() {
if (CurrentAct == 1)
CurrentStageVersion = GammaVersion;

if (CurrentStageVersion == KnucklesVersion || CurrentAct == 2)
if (CurrentAct == 2)
{
CurrentStageVersion = KnucklesVersion;
}
Expand Down
2 changes: 1 addition & 1 deletion sadx-randomizer/AISettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int CheckTailsAI_R(void) { //restriction and bug fixes.
return 0;
break;
case LevelIDs_Casinopolis:
if (CurrentAct >= 1 || CurrentAct == 0 && CurrentMission < 1 && (CurrentAI == Characters_Amy || CurrentCharacter == Characters_Amy)) //cutscene + pinball issue
if (CurrentAct >= 1 || CurrentAct == 0 && (CurrentAI == Characters_Amy || CurrentCharacter == Characters_Amy)) //cutscene + pinball issue
return 0;
break;
case LevelIDs_Chaos0:
Expand Down
7 changes: 2 additions & 5 deletions sadx-randomizer/BackRing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,8 @@ void BackRingObj_Main(ObjectMaster* obj) {
if (CurrentStageVersion == TailsVersion || CurrentStageVersion == AmyVersion)
GameState = 0xc;

if (CurrentLevel == LevelIDs_HotShelter && CurrentAct == 2)
{
GameMode = GameModes_StartAdventure;
}
else if (CurrentStageVersion == GammaVersion && (CurrentLevel == LevelIDs_RedMountain || CurrentLevel == LevelIDs_WindyValley && CurrentAct == 0))

if (CurrentStageVersion == GammaVersion)
{
CurrentLevel = LevelCopy;
CurrentAct = ActCopy;
Expand Down
33 changes: 3 additions & 30 deletions sadx-randomizer/Cutscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@ uint8_t cutsceneAllowedCount = 0;
Trampoline* LoadMRNPC_t = nullptr;
Trampoline* StartCutscene_t;

int EventDayTime[8] = {
6, 11, 21, 57, 98, 157, 159, 249
};

int EventNightTime[6] = {
80, 81, 110, 197, 208, 75
};

int EventEveningTime[4] = {
17, 35, 64, 66
};

//play a random cutscene every 2 levels/bosses.
void CutsceneAllowedCount_Check() {
Expand All @@ -30,27 +20,10 @@ void set_event_flags(long cutsceneID)
{
SeqRun();

if (cutsceneID >= 240 && cutsceneID <= 255 || cutsceneID == 355)
LastStoryFlag = 1;
//randomize time of day


for (int i = 0; i < 7; i++) //fix time of day
{
if (EventDayTime[i] == cutsceneID) {
SetTimeOfDay_Day();
break;
}

if (EventNightTime[i] == cutsceneID) {
SetTimeOfDay_Night();
break;
}

if (EventEveningTime[i] == cutsceneID) {
SetTimeOfDay_Evening();
break;
}
}
uint8_t rng = rand() % 3;
SetTimeOfDay(rng);

switch (cutsceneID) //Credits: PKR
{
Expand Down
6 changes: 4 additions & 2 deletions sadx-randomizer/Missions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ void StageMissionImage_result() {

int LoadTitleCardTexture_r(int minDispTime) {

if (CreditCheck || GetBackRing)
return 0;

if (!isRandoLevel() || CurrentLevel > 14) {

Expand Down Expand Up @@ -294,6 +292,10 @@ int LoadTitleCardTexture_r(int minDispTime) {

void DisplayTitleCard_r() {

if (CreditCheck || GetBackRing) {
return;
}

if (!isRandoLevel()) {
return DisplayScreenTexture(0x4000000, HorizontalStretch * 320.00000000 + 32.00000000,
VerticalStretch * 240.00000000, 1.00000000);
Expand Down

0 comments on commit 708ebe3

Please sign in to comment.