script revision p1

This commit is contained in:
Nikolay Korolev
2021-08-29 19:32:22 +03:00
parent e865e65955
commit 453f8c05a4
25 changed files with 462 additions and 226 deletions

View File

@@ -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<cCustomSoundTrack>::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: