From 5edd9e75da54534fe48c779d4f6c6cd17535be10 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 1 Nov 2020 18:21:05 +0300 Subject: finished script and replay --- src/control/Script.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/control/Script.cpp') diff --git a/src/control/Script.cpp b/src/control/Script.cpp index f85fc076..7c6082c8 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -88,6 +88,8 @@ #include #endif +//--MIAMI: file done + #define PICKUP_PLACEMENT_OFFSET 0.5f #define PED_FIND_Z_OFFSET 5.0f #define COP_PED_FIND_Z_OFFSET 10.0f @@ -15751,7 +15753,7 @@ INITSAVEBUF uint32 script_data_size = SCRIPT_DATA_SIZE; WriteSaveBuf(buf, script_data_size); WriteSaveBuf(buf, OnAMissionFlag); - WriteSaveBuf(buf, NextFreeCollectiveIndex); + WriteSaveBuf(buf, LastMissionPassedTime); for (uint32 i = 0; i < MAX_NUM_BUILDING_SWAPS; i++) { CBuilding* pBuilding = BuildingSwapArray[i].m_pBuilding; uint32 type, handle; @@ -15801,12 +15803,12 @@ INITSAVEBUF WriteSaveBuf(buf, handle); } WriteSaveBuf(buf, bUsingAMultiScriptFile); - WriteSaveBuf(buf, (uint8)0); + WriteSaveBuf(buf, bPlayerHasMetDebbieHarry); WriteSaveBuf(buf, (uint16)0); WriteSaveBuf(buf, MainScriptSize); WriteSaveBuf(buf, LargestMissionScriptSize); WriteSaveBuf(buf, NumberOfMissionScripts); - WriteSaveBuf(buf, (uint16)0); + WriteSaveBuf(buf, NumberOfExclusiveMissionScripts); WriteSaveBuf(buf, runningScripts); for (CRunningScript* pScript = pActiveScripts; pScript; pScript = pScript->GetNext()) pScript->Save(buf); @@ -15823,7 +15825,7 @@ INITSAVEBUF ScriptSpace[i] = ReadSaveBuf(buf); script_assert(ReadSaveBuf(buf) == SCRIPT_DATA_SIZE); OnAMissionFlag = ReadSaveBuf(buf); - NextFreeCollectiveIndex = ReadSaveBuf(buf); + LastMissionPassedTime = ReadSaveBuf(buf); for (uint32 i = 0; i < MAX_NUM_BUILDING_SWAPS; i++) { uint32 type = ReadSaveBuf(buf); uint32 handle = ReadSaveBuf(buf); @@ -15871,12 +15873,12 @@ INITSAVEBUF InvisibilitySettingArray[i]->bIsVisible = false; } script_assert(ReadSaveBuf(buf) == bUsingAMultiScriptFile); - ReadSaveBuf(buf); + bPlayerHasMetDebbieHarry = ReadSaveBuf(buf); ReadSaveBuf(buf); script_assert(ReadSaveBuf(buf) == MainScriptSize); script_assert(ReadSaveBuf(buf) == LargestMissionScriptSize); script_assert(ReadSaveBuf(buf) == NumberOfMissionScripts); - ReadSaveBuf(buf); + script_assert(ReadSaveBuf(buf) == NumberOfExclusiveMissionScripts); uint32 runningScripts = ReadSaveBuf(buf); for (uint32 i = 0; i < runningScripts; i++) StartNewScript(0)->Load(buf); @@ -16103,7 +16105,7 @@ void CTheScripts::CleanUpThisObject(CObject* pObject) if (pObject->ObjectCreatedBy != MISSION_OBJECT) return; pObject->ObjectCreatedBy = TEMP_OBJECT; - pObject->m_nEndOfLifeTime = CTimer::GetTimeInMilliseconds() + 20000; + pObject->m_nEndOfLifeTime = CTimer::GetTimeInMilliseconds() + 20000000; pObject->m_nRefModelIndex = -1; pObject->bUseVehicleColours = false; ++CObject::nNoTempObjects; -- cgit v1.2.3 From bae6c242090ec2a40fab2b58a420892c3b2c7c20 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Mon, 2 Nov 2020 15:54:42 +0300 Subject: fix --- src/control/Script.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/control/Script.cpp') diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 7c6082c8..f9935e21 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -9115,12 +9115,16 @@ int8 CRunningScript::ProcessCommands800To899(int32 command) switch (pPed->m_vehEnterType) { case CAR_DOOR_LF: flags = pPed->m_pMyVehicle->m_nNumMaxPassengers != 0 ? CAR_DOOR_FLAG_LF : CAR_DOOR_FLAG_LF | CAR_DOOR_FLAG_LR; + break; case CAR_DOOR_LR: flags = pPed->m_pMyVehicle->m_nNumMaxPassengers != 0 ? CAR_DOOR_FLAG_RF : CAR_DOOR_FLAG_LF | CAR_DOOR_FLAG_LR; + break; case CAR_DOOR_RF: flags = CAR_DOOR_FLAG_RF; + break; case CAR_DOOR_RR: flags = CAR_DOOR_FLAG_RR; + break; } } pPed->m_pMyVehicle->m_nGettingOutFlags &= ~flags; -- cgit v1.2.3 From 0ccc70c843061ef0a38593863fe2a987e33e10d1 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Mon, 2 Nov 2020 23:53:52 +0300 Subject: embarassing --- src/control/Script.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/control/Script.cpp') diff --git a/src/control/Script.cpp b/src/control/Script.cpp index f9935e21..40fb1ded 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -12125,14 +12125,14 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command) { int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL); CollectParameters(&m_nIp, 1); - UpdateCompareFlag(*ptr = ScriptParams[0]); + UpdateCompareFlag(*ptr == ScriptParams[0]); return 0; } case COMMAND_IS_INT_LVAR_EQUAL_TO_CONSTANT: { int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL); CollectParameters(&m_nIp, 1); - UpdateCompareFlag(*ptr = ScriptParams[0]); + UpdateCompareFlag(*ptr == ScriptParams[0]); return 0; } case COMMAND_GET_DEAD_CHAR_PICKUP_COORDS: -- cgit v1.2.3 From e473123a6aa3769b7aeef54526561c2f1ab32cc1 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Tue, 3 Nov 2020 00:07:25 +0300 Subject: fixes --- src/control/Script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/control/Script.cpp') diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 40fb1ded..6aa314f2 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -12280,7 +12280,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) case COMMAND_IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR: { CollectParameters(&m_nIp, 1); - int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL); + int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL); UpdateCompareFlag(ScriptParams[0] >= *ptr); return 0; } -- cgit v1.2.3