diff --git a/Source/Fodder.cpp b/Source/Fodder.cpp index 8c9261d8..048a4b04 100644 --- a/Source/Fodder.cpp +++ b/Source/Fodder.cpp @@ -3832,7 +3832,12 @@ void cFodder::Campaign_Selection() { // Single Map Mode? if (CampaignFile == "Single Map" || CampaignFile == "Random Map") { - + + if (CampaignFile == "Random Map") { + mStartParams->mSkipRecruit = false; + mParams->mSkipRecruit = false; + } + mGame_Data.mCampaign.SetSingleMapCampaign(); mCustom_Mode = eCustomMode_Map; return; @@ -18243,6 +18248,8 @@ void cFodder::About() { } void cFodder::CreateRandom(sMapParams pParams) { + mSurface->clearBuffer(); + mGame_Data.mCampaign.CreateCustomCampaign(); mGame_Data.mCampaign.setRandom(true); mGame_Data.mCampaign.setName("Random"); @@ -18400,14 +18407,18 @@ bool cFodder::GameOverCheck() { // Demo / Custom Mission restart if (mVersionCurrent->isDemo() && mCustom_Mode != eCustomMode_Set && !mVersionCurrent->isAmigaTheOne()) return false; - + // Reached last map in this mission set? - if (!mGame_Data.Phase_Next()) { + if (!mGame_Data.Phase_Next() && !mVersionDefault->isRandom() && mCustom_Mode != eCustomMode_Map) { mGame_Data.mGameWon = true; WonGame(); return true; } + + if (mVersionDefault->isRandom()) { + mGame_Data.mMission_Recruitment = -1; + } } } diff --git a/Source/Parameters.cpp b/Source/Parameters.cpp index 71899cab..d52b076a 100644 --- a/Source/Parameters.cpp +++ b/Source/Parameters.cpp @@ -265,10 +265,10 @@ bool sFodderParameters::ProcessCLI(int argc, char *argv[]) { mDisableSound = result["nosound"].as(); mPlayground = result["playground"].as(); - mSleepDelta = result["sleep-delta"].as(); - mCheatsEnabled = result["cheats"].as(); + if (result.count("cheats")) + mCheatsEnabled = result["cheats"].as(); if(result.count("rows")) mWindowRows = result["rows"].as(); diff --git a/Source/Recruits.cpp b/Source/Recruits.cpp index 33b321c3..315cc594 100644 --- a/Source/Recruits.cpp +++ b/Source/Recruits.cpp @@ -1163,7 +1163,7 @@ int16 cFodder::Recruit_Show() { } else { - if (mVersionCurrent->mName == "Random Map") { + if (mVersionDefault->mName == "Random Map") { sMapParams Params(mRandom.get()); CreateRandom(Params); mGame_Data.mMission_Recruitment = 0; @@ -1185,7 +1185,7 @@ int16 cFodder::Recruit_Show() { mSound->Music_Play(0); // Retail / Custom set show the Recruitment Hill - if (mVersionCurrent->isRetail() || mVersionCurrent->isPCFormat() || mCustom_Mode == eCustomMode_Set) { + if (mVersionCurrent->isRetail() || mVersionCurrent->isPCFormat() || mVersionCurrent->isRandom() || mCustom_Mode == eCustomMode_Set) { // Recruit Screen if (Recruit_Loop()) diff --git a/Source/Version.hpp b/Source/Version.hpp index 2d098c9b..779c0684 100644 --- a/Source/Version.hpp +++ b/Source/Version.hpp @@ -36,7 +36,8 @@ enum eRelease { AmigaNotVeryFestive, AmigaAlienLevels, - Custom + Custom, + eRandom }; enum eGame { @@ -117,7 +118,11 @@ struct sVersion { } bool isCustom() const { - return mRelease == eRelease::Custom; + return mRelease == eRelease::Custom || isRandom(); + } + + bool isRandom() const { + return mRelease == eRelease::eRandom; } bool isRetail() const { diff --git a/Source/Versions.cpp b/Source/Versions.cpp index 547f94ea..510aef65 100644 --- a/Source/Versions.cpp +++ b/Source/Versions.cpp @@ -112,10 +112,10 @@ const sGameVersion KnownGameVersions[] = { { "Single Map", eGame::CF2, ePlatform::Amiga, eRelease::Custom, "Custom", { } }, { "Single Map", eGame::CF2, ePlatform::PC, eRelease::Custom, "Custom", { } }, - { "Random Map", eGame::CF1, ePlatform::Amiga, eRelease::Custom, "Custom", { } }, - { "Random Map", eGame::CF1, ePlatform::PC, eRelease::Custom, "Custom", { } }, - { "Random Map", eGame::CF2, ePlatform::Amiga, eRelease::Custom, "Custom", { } }, - { "Random Map", eGame::CF2, ePlatform::PC, eRelease::Custom, "Custom", { } }, + { "Random Map", eGame::CF1, ePlatform::Amiga, eRelease::eRandom, "Custom", { } }, + { "Random Map", eGame::CF1, ePlatform::PC, eRelease::eRandom, "Custom", { } }, + { "Random Map", eGame::CF2, ePlatform::Amiga, eRelease::eRandom, "Custom", { } }, + { "Random Map", eGame::CF2, ePlatform::PC, eRelease::eRandom, "Custom", { } }, };