summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-08-01 11:54:05 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2021-08-07 19:24:01 +0200
commitc69edce8007178755d979f638852abb9359950c2 (patch)
treef041976b6ac5421582deae12e056b0d2e6e04ac2
parentlcs specific hack (diff)
downloadre3-c69edce8007178755d979f638852abb9359950c2.tar
re3-c69edce8007178755d979f638852abb9359950c2.tar.gz
re3-c69edce8007178755d979f638852abb9359950c2.tar.bz2
re3-c69edce8007178755d979f638852abb9359950c2.tar.lz
re3-c69edce8007178755d979f638852abb9359950c2.tar.xz
re3-c69edce8007178755d979f638852abb9359950c2.tar.zst
re3-c69edce8007178755d979f638852abb9359950c2.zip
-rw-r--r--src/control/Script.cpp160
-rw-r--r--src/control/Script.h12
-rw-r--r--src/control/Script5.cpp4
-rw-r--r--src/control/Script6.cpp25
-rw-r--r--src/core/Frontend.cpp29
-rw-r--r--src/core/Frontend.h9
-rw-r--r--src/core/MenuScreens.cpp10
-rw-r--r--src/core/MenuScreensCustom.cpp11
-rw-r--r--src/core/Pools.cpp4
-rw-r--r--src/core/config.h10
-rw-r--r--src/save/GenericGameStorage.cpp11
-rw-r--r--src/weapons/Explosion.cpp8
-rw-r--r--src/weapons/Explosion.h6
13 files changed, 256 insertions, 43 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index f52dda03..02701cc0 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -127,7 +127,97 @@ static const char* nonMissionScripts[] = {
"rc4",
"hj",
"usj",
- "mayhem"
+ "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[] = {
+ "LAWYER1",
+ "LAWYER2",
+ "LAWYER3",
+ "LAWYER4",
+ "GENERL1",
+ "COL2",
+ "GENERL3",
+ "COL_4",
+ "COL_5",
+ "baron1",
+ "baron2",
+ "baron3",
+ "baron4",
+ "kent1",
+ "baron5",
+ "serg1",
+ "serg2",
+ "serg3",
+ "bankjo1",
+ "bankjo2",
+ "bankjo3",
+ "bankjo4",
+ "phil1",
+ "phil2",
+ "porno1",
+ "porno2",
+ "porno3",
+ "porno4",
+ "protec1",
+ "protec2",
+ "protec3",
+ "count1",
+ "count2",
+ "CAP_1",
+ "FIN_1",
+ "bike1",
+ "bike2",
+ "bike3",
+ "rockb1",
+ "rockb2",
+ "rockb3",
+ "cuban1",
+ "cuban2",
+ "cuban3",
+ "cuban4",
+ "hait1",
+ "hait2",
+ "hait3",
+ "assin1",
+ "assin2",
+ "assin3",
+ "assin4",
+ "assin5",
+ "taxwar1",
+ "taxwar2",
+ "taxwar3"
};
int AllowMissionReplay;
@@ -143,6 +233,11 @@ bool gbTryingPorn4Again;
int IsInAmmunation;
int MissionSkipLevel;
+#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
+bool UsingMobileScript;
+bool AlreadySavedGame;
+#endif
+
#endif
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
@@ -2703,6 +2798,10 @@ bool CTheScripts::Init(bool loaddata)
PrintToLog(init_msg);
CFileMgr::SetDir("");
#endif
+#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
+ UsingMobileScript = false;
+ AlreadySavedGame = false;
+#endif
return retval;
}
@@ -2779,6 +2878,7 @@ void CTheScripts::Process()
#ifdef MISSION_REPLAY
static uint32 TimeToWaitTill;
+ static bool AlreadyResetHealth;
switch (AllowMissionReplay) {
case 2:
AllowMissionReplay = 3;
@@ -2794,9 +2894,19 @@ void CTheScripts::Process()
break;
case 6:
AllowMissionReplay = 7;
+ AlreadyResetHealth = false;
TimeToWaitTill = CTimer::GetTimeInMilliseconds() + 500;
break;
case 7:
+ if (!AlreadyResetHealth) {
+ AlreadyResetHealth = true;
+ CPlayerPed* pPlayerPed = FindPlayerPed();
+ if (pPlayerPed) {
+ CPlayerInfo* pPlayerInfo = pPlayerPed->GetPlayerInfoForThisPlayerPed();
+ if (pPlayerInfo)
+ pPlayerPed->m_fHealth = pPlayerInfo->m_nMaxHealth;
+ }
+ }
if (TimeToWaitTill < CTimer::GetTimeInMilliseconds()) {
AllowMissionReplay = 0;
return;
@@ -3028,11 +3138,11 @@ int8 CRunningScript::ProcessOneCommand()
}
}
#elif defined USE_BASIC_SCRIPT_DEBUG_OUTPUT
- if (m_bMissionFlag) {
- char tmp[128];
- sprintf(tmp, "Comm %d Cmp %d", command, m_bCondResult);
- CDebug::DebugAddText(tmp);
- }
+ if (m_bMissionFlag) {
+ char tmp[128];
+ sprintf(tmp, "Comm %d Cmp %d", command, m_bCondResult);
+ CDebug::DebugAddText(tmp);
+ }
#endif
return retval;
}
@@ -4447,14 +4557,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
CollectParameters(&m_nIp, 2);
CVehicle* car = CPools::GetVehiclePool()->GetAt(GET_INTEGER_PARAM(0));
script_assert(car);
-#if defined MISSION_REPLAY && defined SIMPLIER_MISSIONS
- car->AutoPilot.m_nCruiseSpeed = GET_FLOAT_PARAM(1);
- if (missionRetryScriptIndex == 40 && car->GetModelIndex() == MI_CHEETAH) // Turismo
- car->AutoPilot.m_nCruiseSpeed = 8 * car->AutoPilot.m_nCruiseSpeed / 10;
- car->AutoPilot.m_nCruiseSpeed = Min(car->AutoPilot.m_nCruiseSpeed, 60.0f * car->pHandling->Transmission.fMaxCruiseVelocity);
-#else
car->AutoPilot.m_nCruiseSpeed = Min(GET_FLOAT_PARAM(1), 60.0f * car->pHandling->Transmission.fMaxCruiseVelocity);
-#endif
return 0;
}
case COMMAND_SET_CAR_DRIVING_STYLE:
@@ -4529,8 +4632,12 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
{
wchar* key = CTheScripts::GetTextByKeyFromScript(&m_nIp);
#ifdef MISSION_REPLAY
- if (strcmp((char*)&CTheScripts::ScriptSpace[m_nIp], "M_FAIL") == 0 && CanAllowMissionReplay())
- AllowMissionReplay = 1;
+ if (strcmp((char*)&CTheScripts::ScriptSpace[m_nIp - KEY_LENGTH_IN_SCRIPT], "M_FAIL") == 0) {
+ if (AllowMissionReplay == 7)
+ AllowMissionReplay = 0;
+ if (CanAllowMissionReplay())
+ AllowMissionReplay = 1;
+ }
#endif
CollectParameters(&m_nIp, 2);
CMessages::AddBigMessage(key, GET_INTEGER_PARAM(0), GET_INTEGER_PARAM(1) - 1);
@@ -5199,21 +5306,15 @@ bool CRunningScript::CanAllowMissionReplay()
{
if (AllowMissionReplay)
return false;
- if (CStats::LastMissionPassedName[0] == '\0')
- return false;
- for (int i = 0; i < ARRAY_SIZE(nonMissionScripts); i++) {
- if (strcmp(m_abScriptName, nonMissionScripts[i]) == 0)
- return false;
+ for (int i = 0; i < ARRAY_SIZE(MissionScripts); i++) {
+ if (!CGeneral::faststricmp(m_abScriptName, MissionScripts[i]))
+ return true;
}
- return true;
+ return false;
}
uint32 AddExtraDeathDelay()
{
- if (missionRetryScriptIndex == 63)
- return 7000;
- if (missionRetryScriptIndex == 64)
- return 4000;
return 1000;
}
@@ -5221,7 +5322,7 @@ void RetryMission(int type, int unk)
{
if (type == 0) {
doingMissionRetry = true;
- FrontEndMenuManager.m_nCurrScreen = 57; // MENUPAGE_MISSION_RETRY
+ FrontEndMenuManager.m_nCurrScreen = MENUPAGE_MISSION_RETRY;
FrontEndMenuManager.RequestFrontEndStartUp();
}
else if (type == 2) {
@@ -5259,8 +5360,11 @@ CTheScripts::SwitchToMission(int32 mission)
#ifdef MISSION_REPLAY
missionRetryScriptIndex = mission;
- if (missionRetryScriptIndex == 19)
- CStats::LastMissionPassedName[0] = '\0';
+#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
+ if (CTheScripts::MissionSupportsMissionReplay(missionRetryScriptIndex)) {
+ SaveGameForPause(4);
+ }
+#endif
#endif
CTimer::Suspend();
int offset = CTheScripts::MultiScriptArray[mission] + 8;
diff --git a/src/control/Script.h b/src/control/Script.h
index 8b54f28f..8c014a0f 100644
--- a/src/control/Script.h
+++ b/src/control/Script.h
@@ -653,6 +653,12 @@ public:
static void SetObjectiveForAllPedsInCollective(int, eObjective);
#endif
+#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
+ static bool MissionSupportsMissionReplay(int index)
+ {
+ return index >= 3 && index <= 35 || index >= 51 && index <= 65 || index >= 67 && index <= 74 || index >= 83 && index <= 87;
+ }
+#endif
static bool IsFortStauntonDestroyed() { return FSDestroyedFlag && *(int32*)&ScriptSpace[FSDestroyedFlag] == 1; }
};
@@ -665,7 +671,6 @@ VALIDATE_SIZE(uStackReturnValue, 4);
extern int scriptToLoad;
#endif
#ifdef MISSION_REPLAY
-static_assert(false, "Mission replay is not supported");
extern int AllowMissionReplay;
extern uint32 WaitForMissionActivate;
extern uint32 WaitForSave;
@@ -676,6 +681,11 @@ extern bool gbTryingPorn4Again;
extern int IsInAmmunation;
extern int MissionSkipLevel;
+#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
+extern bool UsingMobileScript;
+extern bool AlreadySavedGame;
+#endif
+
uint32 AddExtraDeathDelay();
void RetryMission(int, int);
#endif
diff --git a/src/control/Script5.cpp b/src/control/Script5.cpp
index 8544f604..b0605574 100644
--- a/src/control/Script5.cpp
+++ b/src/control/Script5.cpp
@@ -1383,8 +1383,10 @@ void CRunningScript::DoDeatharrestCheck()
if (!pPlayer->IsRestartingAfterDeath() && !pPlayer->IsRestartingAfterArrest())
return;
#ifdef MISSION_REPLAY
- if (AllowMissionReplay != 0)
+ if (AllowMissionReplay != 7 && AllowMissionReplay != 0)
return;
+ if (AllowMissionReplay == 7)
+ AllowMissionReplay = 0;
if (CanAllowMissionReplay())
AllowMissionReplay = 1;
#endif
diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp
index 0e1256fd..29487c62 100644
--- a/src/control/Script6.cpp
+++ b/src/control/Script6.cpp
@@ -125,10 +125,6 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
case COMMAND_MAKE_PLAYER_SAFE_FOR_CUTSCENE:
{
CollectParameters(&m_nIp, 1);
-#ifdef MISSION_REPLAY
- AllowMissionReplay = 0;
- SaveGameForPause(3);
-#endif
CPlayerInfo* pPlayerInfo = &CWorld::Players[GET_INTEGER_PARAM(0)];
CPad::GetPad(GET_INTEGER_PARAM(0))->SetDisablePlayerControls(PLAYERCONTROL_CUTSCENE);
pPlayerInfo->MakePlayerSafe(true);
@@ -372,6 +368,9 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
return 0;
case COMMAND_LOAD_AND_LAUNCH_MISSION_INTERNAL:
{
+#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
+ uint32 oldIp = m_nIp;
+#endif
CollectParameters(&m_nIp, 1);
if (CTheScripts::NumberOfExclusiveMissionScripts > 0) {
@@ -381,8 +380,19 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
}
#ifdef MISSION_REPLAY
missionRetryScriptIndex = GET_INTEGER_PARAM(0);
- if (missionRetryScriptIndex == 19)
- CStats::LastMissionPassedName[0] = '\0';
+#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
+ if (!UsingMobileScript && CTheScripts::MissionSupportsMissionReplay(missionRetryScriptIndex)){
+ if (!AlreadySavedGame) {
+ m_nIp = oldIp - 2;
+ SaveGameForPause(4);
+ AlreadySavedGame = true;
+ return 0;
+ }
+ else {
+ AlreadySavedGame = false;
+ }
+ }
+#endif
#endif
CTimer::Suspend();
int offset = CTheScripts::MultiScriptArray[GET_INTEGER_PARAM(0)] + 8;
@@ -1094,6 +1104,9 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
}
case COMMAND_FAIL_CURRENT_MISSION:
CTheScripts::FailCurrentMission = 2;
+#ifdef MISSION_REPLAY
+ MissionSkipLevel = 0;
+#endif
return 0;
case COMMAND_GET_CLOSEST_OBJECT_OF_TYPE:
{
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 975cc7da..562f8ac3 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -585,7 +585,11 @@ CMenuManager::Initialise(void)
m_fMapCenterX = MENU_X_LEFT_ALIGNED(320.0f);
m_fMapCenterY = MENU_Y(225.0f);
CPad::StopPadsShaking();
+#ifdef MISSION_REPLAY
+ if (!m_OnlySaveMenu && m_nCurrScreen != MENUPAGE_MISSION_RETRY)
+#else
if (!m_OnlySaveMenu)
+#endif
m_nCurrScreen = MENUPAGE_NONE;
DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND);
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_STARTING, 0);
@@ -4728,6 +4732,18 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK");
}
break;
+#ifdef MISSION_REPLAY
+ case MENUACTION_REJECT_RETRY:
+ doingMissionRetry = false;
+ AllowMissionReplay = 0;
+ RequestFrontEndShutDown();
+ break;
+ case MENUACTION_UNK114:
+ doingMissionRetry = false;
+ RequestFrontEndShutDown();
+ RetryMission(2, 0);
+ return;
+#endif
case MENUACTION_SAVEGAME:
{
int saveSlot = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_SaveSlot;
@@ -5373,6 +5389,19 @@ CMenuManager::ProcessFileActions()
{
switch (m_nCurrScreen) {
case MENUPAGE_LOADING_IN_PROGRESS:
+#ifdef MISSION_REPLAY
+ if (MissionSkipLevel) {
+ if (gGameState != GS_PLAYING_GAME)
+ DoSettingsBeforeStartingAGame();
+ RequestFrontEndShutDown();
+ break;
+ }
+ if (doingMissionRetry) {
+ RetryMission(2, 0);
+ m_nCurrSaveSlot = SLOT_COUNT;
+ doingMissionRetry = false;
+ }
+#endif
if (CheckSlotDataValid(m_nCurrSaveSlot)) {
#ifdef USE_DEBUG_SCRIPT_LOADER
scriptToLoad = 0;
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index b4e70613..1a1dd799 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -218,8 +218,11 @@ enum eMenuScreen
#ifdef DETECT_JOYSTICK_MENU
MENUPAGE_DETECT_JOYSTICK,
#endif
-
#endif
+#ifdef MISSION_REPLAY
+ MENUPAGE_MISSION_RETRY,
+#endif
+
MENUPAGE_OUTRO, // Originally 34, but CFO needs last screen to be empty to count number of menu pages
MENUPAGES
};
@@ -288,6 +291,10 @@ enum eMenuAction
MENUACTION_CTRLVIBRATION,
MENUACTION_CTRLCONFIG,
#endif
+#ifdef MISSION_REPLAY
+ MENUACTION_REJECT_RETRY,
+ MENUACTION_UNK114
+#endif
};
enum eCheckHover
diff --git a/src/core/MenuScreens.cpp b/src/core/MenuScreens.cpp
index 20484389..3ffc4e83 100644
--- a/src/core/MenuScreens.cpp
+++ b/src/core/MenuScreens.cpp
@@ -329,6 +329,16 @@ CMenuScreen aScreens[] = {
},
#endif
+#ifdef MISSION_REPLAY
+ // MENUPAGE_MISSION_RETRY = 57 on mobile
+
+ { "M_FAIL", MENUPAGE_DISABLED, 0,
+ MENUACTION_LABEL, "FESZ_RM", SAVESLOT_NONE, MENUPAGE_NONE, 0, 0, 0,
+ MENUACTION_CHANGEMENU, "FEM_YES", SAVESLOT_NONE, MENUPAGE_LOADING_IN_PROGRESS, 320, 200, MENUALIGN_CENTER,
+ MENUACTION_REJECT_RETRY, "FEM_NO", SAVESLOT_NONE, MENUPAGE_NONE, 320, 225, MENUALIGN_CENTER,
+ },
+#endif
+
// MENUPAGE_OUTRO - Originally 34
{ "", 0, 0, },
};
diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp
index 49bb33f8..62b1ebdb 100644
--- a/src/core/MenuScreensCustom.cpp
+++ b/src/core/MenuScreensCustom.cpp
@@ -756,6 +756,17 @@ CMenuScreenCustom aScreens[] = {
},
#endif
+
+#ifdef MISSION_REPLAY
+ // MENUPAGE_MISSION_RETRY = 57 on mobile
+
+ { "M_FAIL", MENUPAGE_DISABLED, nil, nil,
+ MENUACTION_LABEL, "FESZ_RM", { nil, SAVESLOT_NONE, MENUPAGE_NONE }, 0, 0, 0,
+ MENUACTION_CHANGEMENU, "FEM_YES", { nil, SAVESLOT_NONE, MENUPAGE_LOADING_IN_PROGRESS }, 320, 200, MENUALIGN_CENTER,
+ MENUACTION_REJECT_RETRY, "FEM_NO", { nil, SAVESLOT_NONE, MENUPAGE_NONE }, 320, 225, MENUALIGN_CENTER,
+ },
+#endif
+
// MENUPAGE_OUTRO = 34
{ "", 0, nil, nil, },
};
diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp
index a85d6846..c4b4d3b0 100644
--- a/src/core/Pools.cpp
+++ b/src/core/Pools.cpp
@@ -269,7 +269,7 @@ INITSAVEBUF
if (pVehicle->IsBoat() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving))
++nNumBoats;
if (pVehicle->IsBike() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving))
- ++nNumBoats;
+ ++nNumBikes;
#else
if (!pVehicle->pDriver && !bHasPassenger) {
if (pVehicle->IsCar() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
@@ -277,7 +277,7 @@ INITSAVEBUF
if (pVehicle->IsBoat() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
++nNumBoats;
if (pVehicle->IsBike() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
- ++nNumBoats;
+ ++nNumBikes;
#endif
}
}
diff --git a/src/core/config.h b/src/core/config.h
index d8340c37..ac4f1e8b 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -187,6 +187,9 @@ enum Config {
# define PC_MENU
# define PC_WATER
#elif defined GTA_XBOX
+#elif defined GTA_MOBILE
+# define MISSION_REPLAY
+# define SIMPLER_MISSIONS
#endif
// This is enabled for all released games.
@@ -392,8 +395,9 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#endif
#ifdef PC_MENU
//#define MISSION_REPLAY // mobile feature
+//#define SIMPLER_MISSIONS // apply simplifications from mobile
+//#define USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
#endif
-//#define SIMPLIER_MISSIONS // apply simplifications from mobile
#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
#define SCRIPT_LOG_FILE_LEVEL 1 // 0 == no log, 1 == overwrite every frame, 2 == full log
@@ -410,6 +414,10 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#undef USE_BASIC_SCRIPT_DEBUG_OUTPUT
#endif
+#ifndef MISSION_REPLAY
+#undef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
+#endif
+
// Replay
//#define DONT_FIX_REPLAY_BUGS // keeps various bugs in CReplay, some of which are fairly cool!
//#define USE_BETA_REPLAY_MODE // adds another replay mode, a few seconds slomo (caution: buggy!)
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index d2fbb9b0..90a5711e 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -1176,13 +1176,20 @@ void DisplaySaveResult(int unk, char* name)
bool SaveGameForPause(int type)
{
- if (AllowMissionReplay != 0 || type != 3 && WaitForSave > CTimer::GetTimeInMilliseconds())
+ if (AllowMissionReplay != 0 && AllowMissionReplay != 7) {
+ debug("SaveGameForPause failed during AllowMissionReplay %d", AllowMissionReplay);
return false;
+ }
+ if (type != 3 && WaitForSave > CTimer::GetTimeInMilliseconds()) {
+ debug("SaveGameForPause failed WaitForSave");
+ return false;
+ }
WaitForSave = 0;
- if (gGameState != GS_PLAYING_GAME || CTheScripts::IsPlayerOnAMission() || CStats::LastMissionPassedName[0] == '\0') {
+ if (gGameState != GS_PLAYING_GAME || (CTheScripts::bAlreadyRunningAMissionScript && type != 5)) {
DisplaySaveResult(3, CStats::LastMissionPassedName);
return false;
}
+ debug("SaveGameForPause ******************************** %s doSave %d", CStats::LastMissionPassedName, !CTheScripts::bAlreadyRunningAMissionScript);
IsQuickSave = type;
MissionStartTime = 0;
int res = PcSaveHelper.SaveSlot(PAUSE_SAVE_SLOT);
diff --git a/src/weapons/Explosion.cpp b/src/weapons/Explosion.cpp
index 078f01fa..7683ed97 100644
--- a/src/weapons/Explosion.cpp
+++ b/src/weapons/Explosion.cpp
@@ -102,7 +102,11 @@ CExplosion::GetExplosionPosition(uint8 id)
}
bool
+#ifdef SIMPLER_MISSIONS
+CExplosion::AddExplosion(CEntity* explodingEntity, CEntity* culprit, eExplosionType type, const CVector& pos, uint32 lifetime, bool makeSound, float radius)
+#else
CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool makeSound)
+#endif
{
CVector pPosn;
CVector posGround;
@@ -150,7 +154,11 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT
switch (type)
{
case EXPLOSION_GRENADE:
+#ifdef SIMPLER_MISSIONS
+ explosion.m_fRadius = (radius == -1.0f ? 9.0f : radius);
+#else
explosion.m_fRadius = 9.0f;
+#endif
explosion.m_fPower = 300.0f;
explosion.m_fStopTime = lifetime + CTimer::GetTimeInMilliseconds() + 750;
explosion.m_fPropagationRate = 0.5f;
diff --git a/src/weapons/Explosion.h b/src/weapons/Explosion.h
index 7aa02b63..e76c99ea 100644
--- a/src/weapons/Explosion.h
+++ b/src/weapons/Explosion.h
@@ -37,7 +37,11 @@ class CExplosion
float m_fPower;
float m_fZshift;
public:
- static bool AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool makeSound = true); //done(new parametr in android ver is fix for one mission)
+#ifdef SIMPLER_MISSIONS
+ static bool AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool makeSound = true, float radius = -1.0f);
+#else
+ static bool AddExplosion(CEntity* explodingEntity, CEntity* culprit, eExplosionType type, const CVector& pos, uint32 lifetime, bool makeSound = true);
+#endif
static void ClearAllExplosions(); //done
static bool DoesExplosionMakeSound(uint8 id); //done
static int8 GetExplosionActiveCounter(uint8 id); //done