Skip to content

Commit

Permalink
Fix 4 stars during SF/LV races/tournaments.
Browse files Browse the repository at this point in the history
* Reported by pokles
  • Loading branch information
Parik27 committed May 15, 2020
1 parent 25fa2ad commit 02a2fea
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/missions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,19 @@ void __fastcall RandomizeMissionToStart (CRunningScript *scr, void *edx,
auto missionRandomizer = MissionRandomizer::GetInstance ();

scr->CollectParameters (count);

// Don't store missions that are exempt from randomizations unless they're
// required by a continued mission condition
if (std::find (std::begin (exceptions), std::end (exceptions),
ScriptParams[0])
!= std::end (exceptions)
&& missionRandomizer->mContinuedMission == -1)
return;

if (ScriptParams[0] >= START_MISSIONS && ScriptParams[0] <= END_MISSIONS)
{
if (missionRandomizer->mContinuedMission != ScriptParams[0])
{
missionRandomizer->mOriginalMissionNumber = ScriptParams[0];
}
else
missionRandomizer->SetContinuedMission (-1);

Expand Down Expand Up @@ -712,7 +719,7 @@ MissionRandomizer::VerifyMainSCM()

valid = ftell(mainScm) == MAIN_SIZE;
fclose(mainScm);

if(!valid)
Logger::GetLogger ()->LogMessage (
"main.scm is invalid size: expected: 3079599");
Expand Down

0 comments on commit 02a2fea

Please sign in to comment.