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/Script6.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/control/Script6.cpp') diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp index 8dcabd30..94378cc0 100644 --- a/src/control/Script6.cpp +++ b/src/control/Script6.cpp @@ -38,6 +38,7 @@ #include "CarAI.h" #include "Pickups.h" #include "Fluff.h" +#include "CustomSoundTrack.h" // LCS: file done except TODOs @@ -109,9 +110,12 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) CollectParameters(&m_nIp, 2); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(GET_INTEGER_PARAM(0)); script_assert(pVehicle); - script_assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR); - CAutomobile* pCar = (CAutomobile*)pVehicle; - pCar->bNotDamagedUpsideDown = (GET_INTEGER_PARAM(1) != 0); + //assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR); + // they call this for bikes again, we don't really want to destroy the structure... +#ifdef FIX_BUGS + if (pVehicle->m_vehType == VEHICLE_TYPE_CAR) +#endif + ((CAutomobile*)pVehicle)->bNotDamagedUpsideDown = (GET_INTEGER_PARAM(1) != 0); return 0; } case COMMAND_CAN_PLAYER_START_MISSION: @@ -400,7 +404,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) if (size <= 0) size = CTheScripts::LargestMissionScriptSize; CFileMgr::Seek(gScriptsFile, offset, 0); - CFileMgr::Read(gScriptsFile, (const char*)&CTheScripts::ScriptSpace[CTheScripts::MainScriptSize], size); // TODO + CFileMgr::Read(gScriptsFile, (const char*)&CTheScripts::ScriptSpace[CTheScripts::MainScriptSize], size); CRunningScript* pMissionScript = CTheScripts::StartNewScript(CTheScripts::MainScriptSize); CTimer::Resume(); pMissionScript->m_bIsMissionScript = true; @@ -468,8 +472,8 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) return 0; case COMMAND_SET_RADIO_CHANNEL: CollectParameters(&m_nIp, 2); - // if (base::cSingleton::Instance()->unk()) - TODO on PS2, but it's not on mobile - DMAudio.SetRadioChannel(GET_INTEGER_PARAM(0), GET_INTEGER_PARAM(1)); + if (!cCustomSoundTrack::Instance()->IsPlaying()) + DMAudio.SetRadioChannel(GET_INTEGER_PARAM(0), GET_INTEGER_PARAM(1)); return 0; /* case COMMAND_OVERRIDE_HOSPITAL_LEVEL: -- cgit v1.2.3