From 453f8c05a4fc2ef03ba1d4f7bac43ba871c52fbd Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 29 Aug 2021 19:32:22 +0300 Subject: script revision p1 --- src/control/Script.cpp | 68 ++++++-------------------------------------------- 1 file changed, 7 insertions(+), 61 deletions(-) (limited to 'src/control/Script.cpp') diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 59af9ff2..26d9d380 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -179,65 +179,6 @@ static const char* MissionScripts[] = { "TOSH4" }; -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; uint32 NextMissionDelay; uint32 MissionStartTime; @@ -1851,7 +1792,7 @@ int8 CRunningScript::ProcessCommands0To99(int32 command) if (ped) { // great time to check for (int i = 0; i < ped->m_numNearPeds; i++) { CPed* pTestedPed = ped->m_nearPeds[i]; - if (!pTestedPed || !IsPedPointerValid(pTestedPed)) + if (!pTestedPed || !IsPedPointerValid(pTestedPed) || pTestedPed->bIsFrozen) continue; if (pTestedPed->m_pedInObjective == ped && pTestedPed->m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION) { CVector vFollowerPos = pTestedPed->GetFormationPosition(); @@ -1864,7 +1805,7 @@ int8 CRunningScript::ProcessCommands0To99(int32 command) } } } - else if (pTestedPed->m_leader == ped) { + else if (pTestedPed->m_leader == ped && !pTestedPed->bIsFrozen) { CVector vFollowerPos; if (pTestedPed->m_pedFormation) vFollowerPos = pTestedPed->GetFormationPosition(); @@ -2551,6 +2492,9 @@ int8 CRunningScript::ProcessCommands100To199(int32 command) } SET_INTEGER_PARAM(0, handle); StoreParameters(&m_nIp, 1); +#ifdef GTA_NETWORK + // TODO(LCS): register car +#endif if (m_bIsMissionScript) CTheScripts::MissionCleanUp.AddEntityToList(handle, CLEANUP_CAR); return 0; @@ -3128,6 +3072,8 @@ int8 CRunningScript::ProcessCommands200To299(int32 command) case COMMAND_DELETE_OBJECT: { CollectParameters(&m_nIp, 1); + if (GET_INTEGER_PARAM(0) > (NUMOBJECTS + 2) << 8) + return 0; CObject* pObj = CPools::GetObjectPool()->GetAt(GET_INTEGER_PARAM(0)); if (pObj){ CWorld::Remove(pObj); -- cgit v1.2.3