diff options
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/CarAI.cpp | 8 | ||||
-rw-r--r-- | src/control/CarCtrl.cpp | 6 | ||||
-rw-r--r-- | src/control/Darkel.cpp | 5 | ||||
-rw-r--r-- | src/control/GameLogic.cpp | 12 | ||||
-rw-r--r-- | src/control/Garages.cpp | 1 | ||||
-rw-r--r-- | src/control/Phones.cpp | 1 | ||||
-rw-r--r-- | src/control/Pickups.cpp | 4 | ||||
-rw-r--r-- | src/control/Record.h | 6 | ||||
-rw-r--r-- | src/control/Replay.cpp | 6 | ||||
-rw-r--r-- | src/control/Restart.cpp | 8 | ||||
-rw-r--r-- | src/control/RoadBlocks.cpp | 4 | ||||
-rw-r--r-- | src/control/Script.cpp | 64 |
12 files changed, 66 insertions, 59 deletions
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp index 7e517a83..a3fcbf9a 100644 --- a/src/control/CarAI.cpp +++ b/src/control/CarAI.cpp @@ -80,7 +80,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle) if (FindSwitchDistanceClose(pVehicle) > (FindPlayerCoors() - pVehicle->GetPosition()).Magnitude2D() || pVehicle->AutoPilot.m_bIgnorePathfinding) { pVehicle->AutoPilot.m_nCarMission = MISSION_RAMPLAYER_CLOSE; - if (pVehicle->UsesSiren(pVehicle->GetModelIndex())) + if (pVehicle->UsesSiren()) pVehicle->m_bSirenOrAlarm = true; } BackToCruisingIfNoWantedLevel(pVehicle); @@ -136,7 +136,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle) if (FindSwitchDistanceClose(pVehicle) > (FindPlayerCoors() - pVehicle->GetPosition()).Magnitude2D() || pVehicle->AutoPilot.m_bIgnorePathfinding) { pVehicle->AutoPilot.m_nCarMission = MISSION_BLOCKPLAYER_CLOSE; - if (pVehicle->UsesSiren(pVehicle->GetModelIndex())) + if (pVehicle->UsesSiren()) pVehicle->m_bSirenOrAlarm = true; } BackToCruisingIfNoWantedLevel(pVehicle); @@ -294,7 +294,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle) if ((pVehicle->AutoPilot.m_pTargetCar->GetPosition() - pVehicle->GetPosition()).Magnitude2D() < FindSwitchDistanceClose(pVehicle) || pVehicle->AutoPilot.m_bIgnorePathfinding){ pVehicle->AutoPilot.m_nCarMission = MISSION_BLOCKCAR_CLOSE; - if (pVehicle->UsesSiren(pVehicle->GetModelIndex())) + if (pVehicle->UsesSiren()) pVehicle->m_bSirenOrAlarm = true; } }else{ @@ -540,7 +540,7 @@ void CCarAI::AddPoliceCarOccupants(CVehicle* pVehicle) return; pVehicle->bOccupantsHaveBeenGenerated = true; switch (pVehicle->GetModelIndex()){ - case MI_FBICAR: + case MI_FBIRANCH: case MI_ENFORCER: pVehicle->SetUpDriver(); for (int i = 0; i < 3; i++) diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 514150a6..cd08753d 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -366,7 +366,7 @@ CCarCtrl::GenerateOneRandomCar() pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS; pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE; } - if (carModel == MI_FBICAR){ + if (carModel == MI_FBIRANCH){ pVehicle->m_currentColour1 = 0; pVehicle->m_currentColour2 = 0; } @@ -874,9 +874,9 @@ CCarCtrl::ChoosePoliceCarModel(void) CStreaming::HasModelLoaded(MI_POLICE)) return ((CGeneral::GetRandomNumber() & 0xF) == 0) ? MI_ENFORCER : MI_POLICE; if (FindPlayerPed()->m_pWanted->AreFbiRequired() && - CStreaming::HasModelLoaded(MI_FBICAR) && + CStreaming::HasModelLoaded(MI_FBIRANCH) && CStreaming::HasModelLoaded(MI_FBI)) - return MI_FBICAR; + return MI_FBIRANCH; if (FindPlayerPed()->m_pWanted->AreArmyRequired() && CStreaming::HasModelLoaded(MI_RHINO) && CStreaming::HasModelLoaded(MI_BARRACKS) && diff --git a/src/control/Darkel.cpp b/src/control/Darkel.cpp index f00486e8..bbb35080 100644 --- a/src/control/Darkel.cpp +++ b/src/control/Darkel.cpp @@ -27,6 +27,7 @@ int32 CDarkel::KillsNeeded; int8 CDarkel::InterruptedWeapon; /* + * TODO: Collect timer/kill counter RGBA colors on top like in Hud/Frontend. * bStandardSoundAndMessages is a completely beta thing, * makes game handle sounds & messages instead of SCM (just like in GTA2) * but it's never been used in the game. Has unused sliding text when frenzy completed etc. @@ -102,7 +103,7 @@ CDarkel::DrawMessages() if (timeLeft > 4000 || CTimer::GetFrameCounter() & 1) { CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(35.0f), SCREEN_SCALE_Y(109.0f), gUString); - CFont::SetColor(CRGBA(150, 100, 255, 255)); + CFont::SetColor(CRGBA(0, 207, 133, 255)); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(34.0f), SCREEN_SCALE_Y(108.0f), gUString); } } @@ -110,7 +111,7 @@ CDarkel::DrawMessages() AsciiToUnicode(gString, gUString); CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(35.0f), SCREEN_SCALE_Y(144.0f), gUString); - CFont::SetColor(CRGBA(255, 128, 128, 255)); + CFont::SetColor(CRGBA(156, 91, 40, 255)); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(34.0f), SCREEN_SCALE_Y(143.0f), gUString); break; } diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp index af1680ae..2af9464c 100644 --- a/src/control/GameLogic.cpp +++ b/src/control/GameLogic.cpp @@ -155,8 +155,8 @@ CGameLogic::Update() CCarCtrl::ClearInterestingVehicleList(); CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1); CRestart::FindClosestHospitalRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat); - CRestart::OverrideHospitalLevel = LEVEL_NONE; - CRestart::OverridePoliceStationLevel = LEVEL_NONE; + CRestart::OverrideHospitalLevel = LEVEL_GENERIC; + CRestart::OverridePoliceStationLevel = LEVEL_GENERIC; PassTime(720); RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat); AfterDeathArrestSetUpShortCutTaxi(); @@ -261,8 +261,8 @@ CGameLogic::Update() CCarCtrl::ClearInterestingVehicleList(); CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1); CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat); - CRestart::OverrideHospitalLevel = LEVEL_NONE; - CRestart::OverridePoliceStationLevel = LEVEL_NONE; + CRestart::OverrideHospitalLevel = LEVEL_GENERIC; + CRestart::OverridePoliceStationLevel = LEVEL_GENERIC; PassTime(720); RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat); AfterDeathArrestSetUpShortCutTaxi(); @@ -313,8 +313,8 @@ CGameLogic::Update() CCarCtrl::ClearInterestingVehicleList(); CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1); CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat); - CRestart::OverridePoliceStationLevel = LEVEL_NONE; - CRestart::OverrideHospitalLevel = LEVEL_NONE; + CRestart::OverridePoliceStationLevel = LEVEL_GENERIC; + CRestart::OverrideHospitalLevel = LEVEL_GENERIC; RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat); SortOutStreamingAndMemory(pPlayerInfo.GetPos()); TheCamera.m_fCamShakeForce = 0.0f; diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index 66f1851d..6b4ceb80 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -1386,6 +1386,7 @@ bool CGarages::IsCarSprayable(CVehicle * pVehicle) case MI_BARRACKS: case MI_DODO: case MI_COACH: + case MI_FBIRANCH: return false; default: break; diff --git a/src/control/Phones.cpp b/src/control/Phones.cpp index 4f1703f2..71f6c8e5 100644 --- a/src/control/Phones.cpp +++ b/src/control/Phones.cpp @@ -284,6 +284,7 @@ CPhoneInfo::Initialise(void) CBuilding *building = pool->GetSlot(i); if (building) { if (building->GetModelIndex() == MI_PHONEBOOTH1) { + assert(m_nMax < ARRAY_SIZE(m_aPhones) && "NUMPHONES should be increased"); CPhone *maxPhone = &m_aPhones[m_nMax]; maxPhone->m_nState = PHONE_STATE_FREE; maxPhone->m_vecPos = building->GetPosition(); diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp index 95abe2c5..6576be7f 100644 --- a/src/control/Pickups.cpp +++ b/src/control/Pickups.cpp @@ -269,12 +269,12 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId) return true; case PICKUP_COLLECTABLE1: CWorld::Players[playerId].m_nCollectedPackages++; - CWorld::Players[playerId].m_nMoney += 1000; + CWorld::Players[playerId].m_nMoney += 100; if (CWorld::Players[playerId].m_nCollectedPackages == CWorld::Players[playerId].m_nTotalPackages) { printf("All collectables have been picked up\n"); CGarages::TriggerMessage("CO_ALL", -1, 5000, -1); - CWorld::Players[CWorld::PlayerInFocus].m_nMoney += 1000000; + CWorld::Players[CWorld::PlayerInFocus].m_nMoney += 100000; } else CGarages::TriggerMessage("CO_ONE", CWorld::Players[CWorld::PlayerInFocus].m_nCollectedPackages, 5000, CWorld::Players[CWorld::PlayerInFocus].m_nTotalPackages); diff --git a/src/control/Record.h b/src/control/Record.h index 7af733ba..8b55b1f4 100644 --- a/src/control/Record.h +++ b/src/control/Record.h @@ -17,13 +17,13 @@ public: int8 forwardY; int8 forwardZ; int8 wheel; - uint8 gas; - uint8 brake; + int8 gas; + int8 brake; bool handbrake; CVector pos; }; -extern char gString[256];; +extern char gString[256]; class CRecordDataForChase { diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 4407254c..8b34cc3b 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -170,7 +170,7 @@ static void ApplyPanelDamageToCar(uint32 panels, CAutomobile* vehicle, bool flyi void PrintElementsInPtrList(void) { - for (CPtrNode* node = CWorld::GetBigBuildingList(LEVEL_NONE).first; node; node = node->next) { + for (CPtrNode* node = CWorld::GetBigBuildingList(LEVEL_GENERIC).first; node; node = node->next) { /* Most likely debug print was present here */ } } @@ -1143,7 +1143,7 @@ void CReplay::StoreStuffInMem(void) pWorld1 = new uint8[sizeof(CSector) * NUMSECTORS_X * NUMSECTORS_Y]; memcpy(pWorld1, CWorld::GetSector(0, 0), NUMSECTORS_X * NUMSECTORS_Y * sizeof(CSector)); WorldPtrList = CWorld::GetMovingEntityList().first; // why - BigBuildingPtrList = CWorld::GetBigBuildingList(LEVEL_NONE).first; + BigBuildingPtrList = CWorld::GetBigBuildingList(LEVEL_GENERIC).first; pPickups = new uint8[sizeof(CPickup) * NUMPICKUPS]; memcpy(pPickups, CPickups::aPickUps, NUMPICKUPS * sizeof(CPickup)); pReferences = new uint8[(sizeof(CReference) * NUMREFERENCES)]; @@ -1189,7 +1189,7 @@ void CReplay::RestoreStuffFromMem(void) delete[] pWorld1; pWorld1 = nil; CWorld::GetMovingEntityList().first = WorldPtrList; - CWorld::GetBigBuildingList(LEVEL_NONE).first = BigBuildingPtrList; + CWorld::GetBigBuildingList(LEVEL_GENERIC).first = BigBuildingPtrList; memcpy(CPickups::aPickUps, pPickups, sizeof(CPickup) * NUMPICKUPS); delete[] pPickups; pPickups = nil; diff --git a/src/control/Restart.cpp b/src/control/Restart.cpp index 64cabf5d..8fa018d6 100644 --- a/src/control/Restart.cpp +++ b/src/control/Restart.cpp @@ -24,8 +24,8 @@ uint16 CRestart::NumberOfPoliceRestarts; void CRestart::Initialise() { - OverridePoliceStationLevel = LEVEL_NONE; - OverrideHospitalLevel = LEVEL_NONE; + OverridePoliceStationLevel = LEVEL_GENERIC; + OverrideHospitalLevel = LEVEL_GENERIC; bFadeInAfterNextArrest = true; bFadeInAfterNextDeath = true; OverrideHeading = 0.0f; @@ -86,7 +86,7 @@ CRestart::FindClosestHospitalRestartPoint(const CVector &pos, CVector *outPos, f // find closest point on this level for (int i = 0; i < NumberOfHospitalRestarts; i++) { - if (CTheZones::GetLevelFromPosition(&HospitalRestartPoints[i]) == (OverrideHospitalLevel != LEVEL_NONE ? OverrideHospitalLevel : curlevel)) { + if (CTheZones::GetLevelFromPosition(&HospitalRestartPoints[i]) == (OverrideHospitalLevel != LEVEL_GENERIC ? OverrideHospitalLevel : curlevel)) { float dist = (pos - HospitalRestartPoints[i]).MagnitudeSqr(); if (fMinDist >= dist) { fMinDist = dist; @@ -133,7 +133,7 @@ CRestart::FindClosestPoliceRestartPoint(const CVector &pos, CVector *outPos, flo // find closest point on this level for (int i = 0; i < NumberOfPoliceRestarts; i++) { - if (CTheZones::GetLevelFromPosition(&PoliceRestartPoints[i]) == (OverridePoliceStationLevel != LEVEL_NONE ? OverridePoliceStationLevel : curlevel)) { + if (CTheZones::GetLevelFromPosition(&PoliceRestartPoints[i]) == (OverridePoliceStationLevel != LEVEL_GENERIC ? OverridePoliceStationLevel : curlevel)) { float dist = (pos - PoliceRestartPoints[i]).MagnitudeSqr(); if (fMinDist >= dist) { fMinDist = dist; diff --git a/src/control/RoadBlocks.cpp b/src/control/RoadBlocks.cpp index 5d466be2..010dec3f 100644 --- a/src/control/RoadBlocks.cpp +++ b/src/control/RoadBlocks.cpp @@ -67,7 +67,7 @@ CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType eCopType copType = COP_STREET; switch (pVehicle->GetModelIndex()) { - case MI_FBICAR: + case MI_FBIRANCH: modelInfoId = MI_FBI; copType = COP_FBI; break; @@ -236,7 +236,7 @@ CRoadBlocks::CreateRoadBlockBetween2Points(CVector point1, CVector point2) pVehicle->AutoPilot.m_nNextLane = pVehicle->AutoPilot.m_nCurrentLane = 0; pVehicle->AutoPilot.m_nCruiseSpeed = pVehicle->AutoPilot.m_fMaxTrafficSpeed = 0; pVehicle->bExtendedRange = true; - if (pVehicle->UsesSiren(pVehicle->GetModelIndex()) && CGeneral::GetRandomNumber() & 1) + if (pVehicle->UsesSiren() && CGeneral::GetRandomNumber() & 1) pVehicle->m_bSirenOrAlarm = true; if (pVehicle->GetUp().z > 0.94f) { CVisibilityPlugins::SetClumpAlpha(pVehicle->GetClump(), 0); diff --git a/src/control/Script.cpp b/src/control/Script.cpp index c3ca25a6..e1ab0310 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -2292,7 +2292,7 @@ void CTheScripts::Init() dbg_log = fopen("SCRDBG.LOG", "w"); static const char* init_msg = "Starting debug script log\n\n"; PrintToLog(init_msg); - CFileMgr::SetDir("\\"); + CFileMgr::SetDir(""); #endif } @@ -2401,7 +2401,7 @@ void CTheScripts::Process() dbg_log = fopen("SCRDBG.LOG", "w"); static const char* init_msg = "Starting debug script log\n\n"; PrintToLog(init_msg); - CFileMgr::SetDir("\\"); + CFileMgr::SetDir(""); #endif PrintToLog("------------------------\n"); PrintToLog("CTheScripts::Process started, CTimer::GetTimeInMilliseconds == %u\n", CTimer::GetTimeInMilliseconds()); @@ -3806,9 +3806,8 @@ int8 CRunningScript::ProcessCommands100To199(int32 command) UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, x2, y2)); else UpdateCompareFlag(ped->IsWithinArea(x1, y1, x2, y2)); - if (!ScriptParams[5]) - return 0; - CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT); + if (ScriptParams[5]) + CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT); if (CTheScripts::DbgFlag) CTheScripts::DrawDebugSquare(x1, y1, x2, y2); return 0; @@ -3833,9 +3832,8 @@ int8 CRunningScript::ProcessCommands100To199(int32 command) UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, z1, x2, y2, z2)); else UpdateCompareFlag(ped->IsWithinArea(x1, y1, z1, x2, y2, z2)); - if (!ScriptParams[7]) - return 0; - CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2); + if (ScriptParams[7]) + CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2); if (CTheScripts::DbgFlag) CTheScripts::DrawDebugCube(x1, y1, z1, x2, y2, z2); return 0; @@ -9145,7 +9143,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command) CEntity* apEntities[16]; CWorld::FindObjectsOfTypeInRange(mi, pos, range, true, &total, 16, apEntities, true, false, false, true, true); if (total == 0) - CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(LEVEL_NONE), pos, range, true, &total, 16, apEntities); + CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(LEVEL_GENERIC), pos, range, true, &total, 16, apEntities); if (total == 0) CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(CTheZones::GetLevelFromPosition(&pos)), pos, range, true, &total, 16, apEntities); CEntity* pClosestEntity = nil; @@ -9935,7 +9933,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command) CEntity* apEntities[16]; CWorld::FindObjectsOfTypeInRange(mi1, pos, radius, true, &total, 16, apEntities, true, false, false, false, false); if (total == 0) - CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(LEVEL_NONE), pos, radius, true, &total, 16, apEntities); + CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(LEVEL_GENERIC), pos, radius, true, &total, 16, apEntities); if (total == 0) CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(CTheZones::GetLevelFromPosition(&pos)), pos, radius, true, &total, 16, apEntities); CEntity* pClosestEntity = nil; @@ -10595,11 +10593,15 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) CollectParameters(&m_nIp, 1); CTimer::Stop(); CGame::currLevel = (eLevelName)ScriptParams[0]; +#ifndef NO_ISLAND_LOADING CStreaming::RemoveUnusedBigBuildings(CGame::currLevel); CStreaming::RemoveUnusedBuildings(CGame::currLevel); +#endif CCollision::SortOutCollisionAfterLoad(); +#ifndef NO_ISLAND_LOADING CStreaming::RequestIslands(CGame::currLevel); CStreaming::LoadAllRequestedModels(true); +#endif CTimer::Update(); return 0; } @@ -10628,7 +10630,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) if (ScriptParams[1]) pVehicle->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pVehicle->GetPosition()); else - pVehicle->m_nZoneLevel = LEVEL_NONE; + pVehicle->m_nZoneLevel = LEVEL_GENERIC; return 0; } case COMMAND_SET_CHAR_STAYS_IN_CURRENT_LEVEL: @@ -10639,7 +10641,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) if (ScriptParams[1]) pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition()); else - pPed->m_nZoneLevel = LEVEL_NONE; + pPed->m_nZoneLevel = LEVEL_GENERIC; return 0; } */ @@ -10722,12 +10724,9 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) UpdateCompareFlag(CGame::germanGame); return 0; case COMMAND_CLEAR_MISSION_AUDIO: - { CollectParameters(&m_nIp, 1); - debug("CLEAR_MISSION_AUDIO not implemented\n"); - //DMAudio.ClearMissionAudio(ScriptParams[0]); + DMAudio.ClearMissionAudio(ScriptParams[0] - 1); return 0; - } /* case COMMAND_SET_FADE_IN_AFTER_NEXT_ARREST: CollectParameters(&m_nIp, 1); @@ -11280,18 +11279,24 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command) CTimer::Stop(); CGame::currLevel = (eLevelName)ScriptParams[0]; if (CGame::currLevel != CCollision::ms_collisionInMemory) { +#ifndef NO_ISLAND_LOADING DMAudio.SetEffectsFadeVol(0); CPad::StopPadsShaking(); CCollision::LoadCollisionScreen(CGame::currLevel); DMAudio.Service(); +#endif CPopulation::DealWithZoneChange(CCollision::ms_collisionInMemory, CGame::currLevel, false); +#ifndef NO_ISLAND_LOADING CStreaming::RemoveUnusedBigBuildings(CGame::currLevel); CStreaming::RemoveUnusedBuildings(CGame::currLevel); +#endif CCollision::SortOutCollisionAfterLoad(); +#ifndef NO_ISLAND_LOADING CStreaming::RequestIslands(CGame::currLevel); CStreaming::RequestBigBuildings(CGame::currLevel); CStreaming::LoadAllRequestedModels(true); DMAudio.SetEffectsFadeVol(127); +#endif } CTimer::Update(); return 0; @@ -13565,12 +13570,8 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) break; case COMMAND_WANTED_STARS_ARE_FLASHING: { - static bool bShowed = false; - if (!bShowed) { - debug("WANTED_STARS_ARE_FLASHING not implemented, default to FALSE\n"); - bShowed = true; - } - UpdateCompareFlag(false); + CWanted *pWanted = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted; + UpdateCompareFlag(pWanted->m_nMinWantedLevel - pWanted->m_nWantedLevel > 0); return 0; } case COMMAND_SET_ALLOW_HURRICANES: @@ -13622,7 +13623,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) } case COMMAND_DISPLAY_RADAR: CollectParameters(&m_nIp, 1); - debug("DISPLAY_RADAR not implemented\n"); + CHud::m_HideRadar = ScriptParams[0] == 0; return 0; case COMMAND_REGISTER_BEST_POSITION: CollectParameters(&m_nIp, 2); @@ -14421,7 +14422,7 @@ void CRunningScript::LocateCharCommand(int32 command, uint32* pIp) CollectParameters(pIp, b3D ? 8 : 6); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); script_assert(pPed); - CVector pos = pPed->bInVehicle ? pPed->m_pMyVehicle->GetPosition() : pPed->GetPosition(); + CVector pos = pPed->InVehicle() ? pPed->m_pMyVehicle->GetPosition() : pPed->GetPosition(); switch (command) { case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_2D: case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_3D: @@ -15181,7 +15182,7 @@ void CRunningScript::CharInAreaCheckCommand(int32 command, uint32* pIp) CollectParameters(pIp, b3D ? 8 : 6); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); script_assert(pPed); - CVector pos = pPed->bInVehicle ? pPed->m_pMyVehicle->GetPosition() : pPed->GetPosition(); + CVector pos = pPed->InVehicle() ? pPed->m_pMyVehicle->GetPosition() : pPed->GetPosition(); switch (command) { case COMMAND_IS_CHAR_STOPPED_IN_AREA_3D: case COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_3D: @@ -15466,7 +15467,7 @@ void CRunningScript::DoDeatharrestCheck() if (!CTheScripts::IsPlayerOnAMission()) return; CPlayerInfo* pPlayer = &CWorld::Players[CWorld::PlayerInFocus]; - if (!pPlayer->IsRestartingAfterDeath() && !pPlayer->IsRestartingAfterArrest() && !CTheScripts::UpsideDownCars.AreAnyCarsUpsideDown()) + if (!pPlayer->IsRestartingAfterDeath() && !pPlayer->IsRestartingAfterArrest()) return; #ifdef MISSION_REPLAY if (AllowMissionReplay != 0) @@ -15478,6 +15479,7 @@ void CRunningScript::DoDeatharrestCheck() while (m_nStackPointer > 1) --m_nStackPointer; m_nIp = m_anStack[--m_nStackPointer]; + CMessages::ClearSmallMessagesOnly(); *(int32*)&CTheScripts::ScriptSpace[CTheScripts::OnAMissionFlag] = 0; m_bDeatharrestExecuted = true; m_nWakeTime = 0; @@ -15914,22 +15916,24 @@ void CTheScripts::HighlightImportantAngledArea(uint32 id, float x1, float y1, fl bool CTheScripts::IsPedStopped(CPed* pPed) { - if (pPed->bInVehicle) + if (pPed->InVehicle()) return IsVehicleStopped(pPed->m_pMyVehicle); - return pPed->m_nMoveState == eMoveState::PEDMOVE_NONE || pPed->m_nMoveState == eMoveState::PEDMOVE_STILL; + return (pPed->m_nMoveState == eMoveState::PEDMOVE_NONE || pPed->m_nMoveState == eMoveState::PEDMOVE_STILL) && + !pPed->bIsInTheAir && !pPed->bIsLanding && pPed->bIsStanding && pPed->m_vecAnimMoveDelta.x == 0.0f && pPed->m_vecAnimMoveDelta.y == 0.0f; } bool CTheScripts::IsPlayerStopped(CPlayerInfo* pPlayer) { CPed* pPed = pPlayer->m_pPed; - if (pPed->bInVehicle) + if (pPed->InVehicle()) return IsVehicleStopped(pPed->m_pMyVehicle); if (RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP) || RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP_R) || RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_LAUNCH) || RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_GLIDE)) return false; - return pPed->m_nMoveState == eMoveState::PEDMOVE_NONE || pPed->m_nMoveState == eMoveState::PEDMOVE_STILL; + return (pPed->m_nMoveState == eMoveState::PEDMOVE_NONE || pPed->m_nMoveState == eMoveState::PEDMOVE_STILL) && + !pPed->bIsInTheAir && !pPed->bIsLanding && pPed->bIsStanding && pPed->m_vecAnimMoveDelta.x == 0.0f && pPed->m_vecAnimMoveDelta.y == 0.0f; } bool CTheScripts::IsVehicleStopped(CVehicle* pVehicle) |