From 203dff9165d473d030d8945ef80f1c12350662cf Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 9 Jan 2021 20:33:21 +0300 Subject: script --- src/control/Script7.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/control/Script7.cpp') diff --git a/src/control/Script7.cpp b/src/control/Script7.cpp index 344ea2c7..220a7c4d 100644 --- a/src/control/Script7.cpp +++ b/src/control/Script7.cpp @@ -816,7 +816,12 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) //case COMMAND_HAS_CHAR_BEEN_DAMAGED_BY_CAR: //case COMMAND_HAS_CAR_BEEN_DAMAGED_BY_CHAR: //case COMMAND_HAS_CAR_BEEN_DAMAGED_BY_CAR: - //case COMMAND_GET_RADIO_CHANNEL: + case COMMAND_GET_RADIO_CHANNEL: + { + // TODO + ScriptParams[0] = -1; + StoreParameters(&m_nIp, 1); + } //case COMMAND_DISPLAY_TEXT_WITH_3_NUMBERS: //case COMMAND_IS_CAR_DROWNING_IN_WATER: case COMMAND_IS_CHAR_DROWNING_IN_WATER: @@ -1327,7 +1332,19 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) CollectParameters(&m_nIp, 1); UpdateCompareFlag(CPools::GetPedPool()->GetAt(ScriptParams[0]) != 0); return 0; - //case COMMAND_DOES_VEHICLE_EXIST: + case COMMAND_DOES_VEHICLE_EXIST: + { + // TODO + CollectParameters(&m_nIp, 1); + CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]); + bool bExist = false; + if (pVehicle) { + int index = CPools::GetVehiclePool()->GetJustIndex_NoFreeAssert(pVehicle); + bExist = (index >= 0 && index <= NUMVEHICLES); // TODO: FIX_BUGS + } + UpdateCompareFlag(bExist); + return 0; + } //case COMMAND_ADD_SHORT_RANGE_BLIP_FOR_CONTACT_POINT: case COMMAND_ADD_SHORT_RANGE_SPRITE_BLIP_FOR_CONTACT_POINT: { -- cgit v1.2.3