1
0
Fork 0
mirror of https://github.com/halpz/re3.git synced 2025-01-08 20:25:28 +00:00

disable mission replay for lcs

This commit is contained in:
Nikolay Korolev 2021-08-08 10:51:04 +03:00
parent 2672504e8a
commit 0c4ab5b609
4 changed files with 76 additions and 130 deletions

View file

@ -112,112 +112,71 @@ base::cSList<script_corona> CTheScripts::mCoronas;
#ifdef MISSION_REPLAY #ifdef MISSION_REPLAY
static const char* nonMissionScripts[] = {
"copcar",
"ambulan",
"taxi",
"firetru",
"rampage",
"t4x4_1",
"t4x4_2",
"t4x4_3",
"rc1",
"rc2",
"rc3",
"rc4",
"hj",
"usj",
"mayhem",
"range",
"race",
"pizza",
"rcheli",
"rcplne1",
"rcrace1",
"cokerun",
"buypro1",
"carbuy1",
"buypro2",
"icecut",
"icecre1",
"buypro3",
"buypro4",
"buypro5",
"buypro6",
"buypro7",
"buypro8",
"buypro9",
"buypro10",
"buypro11",
"ovalrng",
"mm",
"kickst",
"heli1sc",
"heli2sc",
"heli3sc",
"heli4sc",
"carpark_1",
"bmx_1",
"bmx_2"
};
static const char* MissionScripts[] = { static const char* MissionScripts[] = {
"LAWYER1", "VIC2",
"LAWYER2", "VIC3",
"LAWYER3", "VIC4",
"LAWYER4", "VIC5",
"GENERL1", "VIC6",
"COL2", "VIC7",
"GENERL3", "SAL1",
"COL_4", "SAL2",
"COL_5", "SAL3",
"baron1", "SAL4",
"baron2", "SAL5",
"baron3", "SAL6",
"baron4", "SAL7",
"kent1", "SAL8",
"baron5", "JDT1",
"serg1", "JDT2",
"serg2", "JDT3",
"serg3", "JDT4",
"bankjo1", "JDT5",
"bankjo2", "JDT6",
"bankjo3", "JDT7",
"bankjo4", "JDT8",
"phil1", "MAC1",
"phil2", "MAC2",
"porno1", "MAC3",
"porno2", "MAC4",
"porno3", "MAC5",
"porno4", "SALS1",
"protec1", "SALS2",
"protec2", "SALS3",
"protec3", "SALS4",
"count1", "SALS5",
"count2", "SALS6",
"CAP_1", "RAYS1",
"FIN_1", "RAYS2",
"bike1", "RAYS3",
"bike2", "RAYS4",
"bike3", "RAYS5",
"rockb1", "DONS1",
"rockb2", "DONS2",
"rockb3", "DONS3",
"cuban1", "DONS4",
"cuban2", "DONS5",
"cuban3", "DONS6",
"cuban4", "DONS7",
"hait1", "NEDS1",
"hait2", "NEDS2",
"hait3", "NEDS3",
"assin1", "NEDS4",
"assin2", "SALH1",
"assin3", "SALH2",
"assin4", "SALH3",
"assin5", "SALH4",
"taxwar1", "SALH5",
"taxwar2", "DONH1",
"taxwar3" "DONH2",
"DONH3",
"DONH4",
"DONH5",
"DONH6",
"TOSH1",
"TOSH2",
"TOSH3",
"TOSH4"
}; };
int AllowMissionReplay; int AllowMissionReplay;
@ -234,7 +193,6 @@ int IsInAmmunation;
int MissionSkipLevel; int MissionSkipLevel;
#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT #ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
bool UsingMobileScript;
bool AlreadySavedGame; bool AlreadySavedGame;
#endif #endif
@ -1003,7 +961,6 @@ bool CTheScripts::Init(bool loaddata)
LogAfterScriptInitializing(); LogAfterScriptInitializing();
#endif #endif
#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT #ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
UsingMobileScript = false;
AlreadySavedGame = false; AlreadySavedGame = false;
#endif #endif
return retval; return retval;

View file

@ -668,7 +668,7 @@ public:
#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT #ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
static bool MissionSupportsMissionReplay(int index) static bool MissionSupportsMissionReplay(int index)
{ {
return index >= 3 && index <= 35 || index >= 51 && index <= 65 || index >= 67 && index <= 74 || index >= 83 && index <= 87; return (index >= 48 && index <= 61) || (index >= 63 && index <= 117);
} }
#endif #endif
static bool IsFortStauntonDestroyed() { return FSDestroyedFlag && *(int32*)&ScriptSpace[FSDestroyedFlag] == 1; } static bool IsFortStauntonDestroyed() { return FSDestroyedFlag && *(int32*)&ScriptSpace[FSDestroyedFlag] == 1; }
@ -700,7 +700,6 @@ extern int IsInAmmunation;
extern int MissionSkipLevel; extern int MissionSkipLevel;
#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT #ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
extern bool UsingMobileScript;
extern bool AlreadySavedGame; extern bool AlreadySavedGame;
#endif #endif

View file

@ -381,7 +381,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
#ifdef MISSION_REPLAY #ifdef MISSION_REPLAY
missionRetryScriptIndex = GET_INTEGER_PARAM(0); missionRetryScriptIndex = GET_INTEGER_PARAM(0);
#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT #ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
if (!UsingMobileScript && CTheScripts::MissionSupportsMissionReplay(missionRetryScriptIndex)){ if (CTheScripts::MissionSupportsMissionReplay(missionRetryScriptIndex)){
if (!AlreadySavedGame) { if (!AlreadySavedGame) {
m_nIp = oldIp - 2; m_nIp = oldIp - 2;
SaveGameForPause(4); SaveGameForPause(4);

View file

@ -1946,8 +1946,7 @@ void CRunningScript::LogAfterProcessingCommand(int32 command)
CDebug::DebugAddText(commandInfo); CDebug::DebugAddText(commandInfo);
} }
} }
}
#endif
#ifdef MISSION_SWITCHER #ifdef MISSION_SWITCHER
void void
@ -1975,30 +1974,21 @@ CTheScripts::SwitchToMission(int32 mission)
#ifdef MISSION_REPLAY #ifdef MISSION_REPLAY
missionRetryScriptIndex = mission; missionRetryScriptIndex = mission;
#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
if (CTheScripts::MissionSupportsMissionReplay(missionRetryScriptIndex)) {
SaveGameForPause(4);
}
#endif
#endif #endif
CTimer::Suspend(); CTimer::Suspend();
int offset = CTheScripts::MultiScriptArray[mission]; int offset = CTheScripts::MultiScriptArray[mission] + 8;
#ifdef USE_DEBUG_SCRIPT_LOADER int size = CTheScripts::MultiScriptArray[mission + 1] - CTheScripts::MultiScriptArray[mission];
CFileMgr::ChangeDir("\\data\\"); if (size <= 0)
int handle = CFileMgr::OpenFile(scriptfile, "rb"); size = CTheScripts::LargestMissionScriptSize;
CFileMgr::ChangeDir("\\"); CFileMgr::Seek(gScriptsFile, offset, 0);
#else CFileMgr::Read(gScriptsFile, (const char*)&CTheScripts::ScriptSpace[CTheScripts::MainScriptSize], size);
CFileMgr::ChangeDir("\\"); CRunningScript* pMissionScript = CTheScripts::StartNewScript(CTheScripts::MainScriptSize);
int handle = CFileMgr::OpenFile("data\\main.scm", "rb");
#endif
CFileMgr::Seek(handle, offset, 0);
CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
CFileMgr::CloseFile(handle);
CRunningScript* pMissionScript = CTheScripts::StartNewScript(SIZE_MAIN_SCRIPT);
CTimer::Resume(); CTimer::Resume();
pMissionScript->m_bIsMissionScript = true; pMissionScript->m_bIsMissionScript = true;
pMissionScript->m_bMissionFlag = true; pMissionScript->m_bMissionFlag = true;
CTheScripts::bAlreadyRunningAMissionScript = true; CTheScripts::bAlreadyRunningAMissionScript = true;
memset(&CTheScripts::ScriptSpace[CTheScripts::NumTrueGlobals * 4 + 8], 0, CTheScripts::MostGlobals * 4);
CGameLogic::ClearShortCut(); CGameLogic::ClearShortCut();
pMissionScript->Process();
} }
#endif #endif