Merge pull request #654 from erorcun/miami

VC fighting, Peds, many fixes including ghost bikes
This commit is contained in:
erorcun 2020-07-10 00:06:16 +03:00 committed by GitHub
commit 30723cf723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 813 additions and 506 deletions

View File

@ -238,14 +238,14 @@ AnimAssocDesc aMeleeAnimDescs[] = {
{ ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, { ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
{ ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT }, { ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT },
{ ANIM_WEAPON_SPECIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, // TODO(Miami): Overload that name for melee/swing { ANIM_MELEE_ATTACK_FINISH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
}; };
AnimAssocDesc aSwingAnimDescs[] = { AnimAssocDesc aSwingAnimDescs[] = {
{ ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT }, { ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT },
{ ANIM_WEAPON_SPECIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, // TODO(Miami): Overload that name for melee/swing { ANIM_MELEE_ATTACK_FINISH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
}; };
AnimAssocDesc aWeaponAnimDescs[] = { AnimAssocDesc aWeaponAnimDescs[] = {
{ ANIM_WEAPON_FIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_WEAPON_FIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },

View File

@ -234,6 +234,7 @@ enum AnimationId
ANIM_MELEE_ATTACK_2ND, ANIM_MELEE_ATTACK_2ND,
ANIM_MELEE_ATTACK_START, ANIM_MELEE_ATTACK_START,
ANIM_MELEE_IDLE_FIGHTMODE, ANIM_MELEE_IDLE_FIGHTMODE,
ANIM_MELEE_ATTACK_FINISH,
ANIM_THROWABLE_THROW = ANIM_WEAPON_FIRE, ANIM_THROWABLE_THROW = ANIM_WEAPON_FIRE,
ANIM_THROWABLE_THROWU, ANIM_THROWABLE_THROWU,
ANIM_THROWABLE_START_THROW, ANIM_THROWABLE_START_THROW,

View File

@ -5724,6 +5724,8 @@ cAudioManager::ClearMissionAudio(uint8 slot)
m_sMissionAudio.m_bIsPlayed[slot] = false; m_sMissionAudio.m_bIsPlayed[slot] = false;
m_sMissionAudio.m_bPredefinedProperties[slot] = true; m_sMissionAudio.m_bPredefinedProperties[slot] = true;
m_sMissionAudio.m_nMissionAudioCounter[slot] = 0; m_sMissionAudio.m_nMissionAudioCounter[slot] = 0;
m_sMissionAudio.m_bIsMobile[slot] = false;
SampleManager.StopStreamedFile(slot + 1);
} }
} }

View File

@ -714,16 +714,18 @@ cMusicManager::UsesPoliceRadio(CVehicle *veh)
{ {
switch (veh->GetModelIndex()) switch (veh->GetModelIndex())
{ {
case MI_FBICAR: case MI_VCNMAV:
case MI_POLICE: case MI_POLMAV:
case MI_ENFORCER: case MI_COASTG:
case MI_PREDATOR:
case MI_RHINO: case MI_RHINO:
case MI_BARRACKS: case MI_BARRACKS:
return true; return true;
} case MI_MRWHOOP:
case MI_HUNTER:
return false; return false;
} }
return veh->UsesSiren();
}
void void
cMusicManager::ServiceAmbience() cMusicManager::ServiceAmbience()

View File

@ -80,7 +80,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
if (FindSwitchDistanceClose(pVehicle) > (FindPlayerCoors() - pVehicle->GetPosition()).Magnitude2D() || if (FindSwitchDistanceClose(pVehicle) > (FindPlayerCoors() - pVehicle->GetPosition()).Magnitude2D() ||
pVehicle->AutoPilot.m_bIgnorePathfinding) { pVehicle->AutoPilot.m_bIgnorePathfinding) {
pVehicle->AutoPilot.m_nCarMission = MISSION_RAMPLAYER_CLOSE; pVehicle->AutoPilot.m_nCarMission = MISSION_RAMPLAYER_CLOSE;
if (pVehicle->UsesSiren(pVehicle->GetModelIndex())) if (pVehicle->UsesSiren())
pVehicle->m_bSirenOrAlarm = true; pVehicle->m_bSirenOrAlarm = true;
} }
BackToCruisingIfNoWantedLevel(pVehicle); BackToCruisingIfNoWantedLevel(pVehicle);
@ -136,7 +136,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
if (FindSwitchDistanceClose(pVehicle) > (FindPlayerCoors() - pVehicle->GetPosition()).Magnitude2D() || if (FindSwitchDistanceClose(pVehicle) > (FindPlayerCoors() - pVehicle->GetPosition()).Magnitude2D() ||
pVehicle->AutoPilot.m_bIgnorePathfinding) { pVehicle->AutoPilot.m_bIgnorePathfinding) {
pVehicle->AutoPilot.m_nCarMission = MISSION_BLOCKPLAYER_CLOSE; pVehicle->AutoPilot.m_nCarMission = MISSION_BLOCKPLAYER_CLOSE;
if (pVehicle->UsesSiren(pVehicle->GetModelIndex())) if (pVehicle->UsesSiren())
pVehicle->m_bSirenOrAlarm = true; pVehicle->m_bSirenOrAlarm = true;
} }
BackToCruisingIfNoWantedLevel(pVehicle); BackToCruisingIfNoWantedLevel(pVehicle);
@ -294,7 +294,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
if ((pVehicle->AutoPilot.m_pTargetCar->GetPosition() - pVehicle->GetPosition()).Magnitude2D() < FindSwitchDistanceClose(pVehicle) || if ((pVehicle->AutoPilot.m_pTargetCar->GetPosition() - pVehicle->GetPosition()).Magnitude2D() < FindSwitchDistanceClose(pVehicle) ||
pVehicle->AutoPilot.m_bIgnorePathfinding){ pVehicle->AutoPilot.m_bIgnorePathfinding){
pVehicle->AutoPilot.m_nCarMission = MISSION_BLOCKCAR_CLOSE; pVehicle->AutoPilot.m_nCarMission = MISSION_BLOCKCAR_CLOSE;
if (pVehicle->UsesSiren(pVehicle->GetModelIndex())) if (pVehicle->UsesSiren())
pVehicle->m_bSirenOrAlarm = true; pVehicle->m_bSirenOrAlarm = true;
} }
}else{ }else{
@ -540,7 +540,7 @@ void CCarAI::AddPoliceCarOccupants(CVehicle* pVehicle)
return; return;
pVehicle->bOccupantsHaveBeenGenerated = true; pVehicle->bOccupantsHaveBeenGenerated = true;
switch (pVehicle->GetModelIndex()){ switch (pVehicle->GetModelIndex()){
case MI_FBICAR: case MI_FBIRANCH:
case MI_ENFORCER: case MI_ENFORCER:
pVehicle->SetUpDriver(); pVehicle->SetUpDriver();
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)

View File

@ -366,7 +366,7 @@ CCarCtrl::GenerateOneRandomCar()
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS; pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS;
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE; pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
} }
if (carModel == MI_FBICAR){ if (carModel == MI_FBIRANCH){
pVehicle->m_currentColour1 = 0; pVehicle->m_currentColour1 = 0;
pVehicle->m_currentColour2 = 0; pVehicle->m_currentColour2 = 0;
} }
@ -874,9 +874,9 @@ CCarCtrl::ChoosePoliceCarModel(void)
CStreaming::HasModelLoaded(MI_POLICE)) CStreaming::HasModelLoaded(MI_POLICE))
return ((CGeneral::GetRandomNumber() & 0xF) == 0) ? MI_ENFORCER : MI_POLICE; return ((CGeneral::GetRandomNumber() & 0xF) == 0) ? MI_ENFORCER : MI_POLICE;
if (FindPlayerPed()->m_pWanted->AreFbiRequired() && if (FindPlayerPed()->m_pWanted->AreFbiRequired() &&
CStreaming::HasModelLoaded(MI_FBICAR) && CStreaming::HasModelLoaded(MI_FBIRANCH) &&
CStreaming::HasModelLoaded(MI_FBI)) CStreaming::HasModelLoaded(MI_FBI))
return MI_FBICAR; return MI_FBIRANCH;
if (FindPlayerPed()->m_pWanted->AreArmyRequired() && if (FindPlayerPed()->m_pWanted->AreArmyRequired() &&
CStreaming::HasModelLoaded(MI_RHINO) && CStreaming::HasModelLoaded(MI_RHINO) &&
CStreaming::HasModelLoaded(MI_BARRACKS) && CStreaming::HasModelLoaded(MI_BARRACKS) &&

View File

@ -67,7 +67,7 @@ CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType
eCopType copType = COP_STREET; eCopType copType = COP_STREET;
switch (pVehicle->GetModelIndex()) switch (pVehicle->GetModelIndex())
{ {
case MI_FBICAR: case MI_FBIRANCH:
modelInfoId = MI_FBI; modelInfoId = MI_FBI;
copType = COP_FBI; copType = COP_FBI;
break; break;
@ -236,7 +236,7 @@ CRoadBlocks::CreateRoadBlockBetween2Points(CVector point1, CVector point2)
pVehicle->AutoPilot.m_nNextLane = pVehicle->AutoPilot.m_nCurrentLane = 0; pVehicle->AutoPilot.m_nNextLane = pVehicle->AutoPilot.m_nCurrentLane = 0;
pVehicle->AutoPilot.m_nCruiseSpeed = pVehicle->AutoPilot.m_fMaxTrafficSpeed = 0; pVehicle->AutoPilot.m_nCruiseSpeed = pVehicle->AutoPilot.m_fMaxTrafficSpeed = 0;
pVehicle->bExtendedRange = true; pVehicle->bExtendedRange = true;
if (pVehicle->UsesSiren(pVehicle->GetModelIndex()) && CGeneral::GetRandomNumber() & 1) if (pVehicle->UsesSiren() && CGeneral::GetRandomNumber() & 1)
pVehicle->m_bSirenOrAlarm = true; pVehicle->m_bSirenOrAlarm = true;
if (pVehicle->GetUp().z > 0.94f) { if (pVehicle->GetUp().z > 0.94f) {
CVisibilityPlugins::SetClumpAlpha(pVehicle->GetClump(), 0); CVisibilityPlugins::SetClumpAlpha(pVehicle->GetClump(), 0);

View File

@ -3806,8 +3806,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, x2, y2)); UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, x2, y2));
else else
UpdateCompareFlag(ped->IsWithinArea(x1, y1, x2, y2)); UpdateCompareFlag(ped->IsWithinArea(x1, y1, x2, y2));
if (!ScriptParams[5]) if (ScriptParams[5])
return 0;
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT); CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
if (CTheScripts::DbgFlag) if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugSquare(x1, y1, x2, y2); CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
@ -3833,8 +3832,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, z1, x2, y2, z2)); UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, z1, x2, y2, z2));
else else
UpdateCompareFlag(ped->IsWithinArea(x1, y1, z1, x2, y2, z2)); UpdateCompareFlag(ped->IsWithinArea(x1, y1, z1, x2, y2, z2));
if (!ScriptParams[7]) if (ScriptParams[7])
return 0;
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2); CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
if (CTheScripts::DbgFlag) if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugCube(x1, y1, z1, x2, y2, z2); CTheScripts::DrawDebugCube(x1, y1, z1, x2, y2, z2);
@ -10722,12 +10720,9 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
UpdateCompareFlag(CGame::germanGame); UpdateCompareFlag(CGame::germanGame);
return 0; return 0;
case COMMAND_CLEAR_MISSION_AUDIO: case COMMAND_CLEAR_MISSION_AUDIO:
{
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
debug("CLEAR_MISSION_AUDIO not implemented\n"); DMAudio.ClearMissionAudio(ScriptParams[0] - 1);
//DMAudio.ClearMissionAudio(ScriptParams[0]);
return 0; return 0;
}
/* /*
case COMMAND_SET_FADE_IN_AFTER_NEXT_ARREST: case COMMAND_SET_FADE_IN_AFTER_NEXT_ARREST:
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
@ -13565,12 +13560,8 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
break; break;
case COMMAND_WANTED_STARS_ARE_FLASHING: case COMMAND_WANTED_STARS_ARE_FLASHING:
{ {
static bool bShowed = false; CWanted *pWanted = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted;
if (!bShowed) { UpdateCompareFlag(pWanted->m_nMinWantedLevel - pWanted->m_nWantedLevel > 0);
debug("WANTED_STARS_ARE_FLASHING not implemented, default to FALSE\n");
bShowed = true;
}
UpdateCompareFlag(false);
return 0; return 0;
} }
case COMMAND_SET_ALLOW_HURRICANES: case COMMAND_SET_ALLOW_HURRICANES:
@ -13622,7 +13613,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
} }
case COMMAND_DISPLAY_RADAR: case COMMAND_DISPLAY_RADAR:
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
debug("DISPLAY_RADAR not implemented\n"); CHud::m_HideRadar = ScriptParams[0] == 0;
return 0; return 0;
case COMMAND_REGISTER_BEST_POSITION: case COMMAND_REGISTER_BEST_POSITION:
CollectParameters(&m_nIp, 2); CollectParameters(&m_nIp, 2);
@ -14421,7 +14412,7 @@ void CRunningScript::LocateCharCommand(int32 command, uint32* pIp)
CollectParameters(pIp, b3D ? 8 : 6); CollectParameters(pIp, b3D ? 8 : 6);
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
script_assert(pPed); 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) { switch (command) {
case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_2D: case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_2D:
case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_3D: case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_3D:
@ -15181,7 +15172,7 @@ void CRunningScript::CharInAreaCheckCommand(int32 command, uint32* pIp)
CollectParameters(pIp, b3D ? 8 : 6); CollectParameters(pIp, b3D ? 8 : 6);
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
script_assert(pPed); 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) { switch (command) {
case COMMAND_IS_CHAR_STOPPED_IN_AREA_3D: case COMMAND_IS_CHAR_STOPPED_IN_AREA_3D:
case COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_3D: case COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_3D:
@ -15466,7 +15457,7 @@ void CRunningScript::DoDeatharrestCheck()
if (!CTheScripts::IsPlayerOnAMission()) if (!CTheScripts::IsPlayerOnAMission())
return; return;
CPlayerInfo* pPlayer = &CWorld::Players[CWorld::PlayerInFocus]; CPlayerInfo* pPlayer = &CWorld::Players[CWorld::PlayerInFocus];
if (!pPlayer->IsRestartingAfterDeath() && !pPlayer->IsRestartingAfterArrest() && !CTheScripts::UpsideDownCars.AreAnyCarsUpsideDown()) if (!pPlayer->IsRestartingAfterDeath() && !pPlayer->IsRestartingAfterArrest())
return; return;
#ifdef MISSION_REPLAY #ifdef MISSION_REPLAY
if (AllowMissionReplay != 0) if (AllowMissionReplay != 0)
@ -15478,6 +15469,7 @@ void CRunningScript::DoDeatharrestCheck()
while (m_nStackPointer > 1) while (m_nStackPointer > 1)
--m_nStackPointer; --m_nStackPointer;
m_nIp = m_anStack[--m_nStackPointer]; m_nIp = m_anStack[--m_nStackPointer];
CMessages::ClearSmallMessagesOnly();
*(int32*)&CTheScripts::ScriptSpace[CTheScripts::OnAMissionFlag] = 0; *(int32*)&CTheScripts::ScriptSpace[CTheScripts::OnAMissionFlag] = 0;
m_bDeatharrestExecuted = true; m_bDeatharrestExecuted = true;
m_nWakeTime = 0; m_nWakeTime = 0;
@ -15914,22 +15906,24 @@ void CTheScripts::HighlightImportantAngledArea(uint32 id, float x1, float y1, fl
bool CTheScripts::IsPedStopped(CPed* pPed) bool CTheScripts::IsPedStopped(CPed* pPed)
{ {
if (pPed->bInVehicle) if (pPed->InVehicle())
return IsVehicleStopped(pPed->m_pMyVehicle); 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) bool CTheScripts::IsPlayerStopped(CPlayerInfo* pPlayer)
{ {
CPed* pPed = pPlayer->m_pPed; CPed* pPed = pPlayer->m_pPed;
if (pPed->bInVehicle) if (pPed->InVehicle())
return IsVehicleStopped(pPed->m_pMyVehicle); return IsVehicleStopped(pPed->m_pMyVehicle);
if (RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP) || if (RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP) ||
RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP_R) || RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP_R) ||
RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_LAUNCH) || RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_LAUNCH) ||
RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_GLIDE)) RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_GLIDE))
return false; 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) bool CTheScripts::IsVehicleStopped(CVehicle* pVehicle)

View File

@ -766,6 +766,7 @@ void CRadar::DrawMap()
m_radarRange = RADAR_MIN_RANGE; m_radarRange = RADAR_MIN_RANGE;
vec2DRadarOrigin = CVector2D(FindPlayerCentreOfWorld_NoSniperShift()); vec2DRadarOrigin = CVector2D(FindPlayerCentreOfWorld_NoSniperShift());
if (FrontEndMenuManager.m_PrefsRadarMode != 1)
DrawRadarMap(); DrawRadarMap();
} }
} }

View File

@ -1380,11 +1380,11 @@ CStreaming::StreamVehiclesAndPeds(void)
} }
if(FindPlayerPed()->m_pWanted->AreFbiRequired()){ if(FindPlayerPed()->m_pWanted->AreFbiRequired()){
RequestModel(MI_FBICAR, STREAMFLAGS_DONT_REMOVE); RequestModel(MI_FBIRANCH, STREAMFLAGS_DONT_REMOVE);
RequestModel(MI_FBI, STREAMFLAGS_DONT_REMOVE); RequestModel(MI_FBI, STREAMFLAGS_DONT_REMOVE);
}else{ }else{
SetModelIsDeletable(MI_FBICAR); SetModelIsDeletable(MI_FBIRANCH);
if(!HasModelLoaded(MI_FBICAR)) if(!HasModelLoaded(MI_FBIRANCH))
SetModelIsDeletable(MI_FBI); SetModelIsDeletable(MI_FBI);
} }

View File

@ -82,6 +82,7 @@ CCopPed::CCopPed(eCopType copType, int32 modifier) : CPed(PEDTYPE_COP)
m_bZoneDisabled = false; m_bZoneDisabled = false;
field_628 = -1; field_628 = -1;
m_nRoadblockNode = -1; // TODO(Miami): this will be nil m_nRoadblockNode = -1; // TODO(Miami): this will be nil
m_bThrowsSpikeTrap = false;
field_5FF = 0; field_5FF = 0;
m_fAbseilPos = 0.0f; m_fAbseilPos = 0.0f;
m_bBeatingSuspect = false; m_bBeatingSuspect = false;

View File

@ -25,6 +25,7 @@ public:
bool m_bZoneDisabled; bool m_bZoneDisabled;
float m_fAbseilPos; float m_fAbseilPos;
eCopType m_nCopType; eCopType m_nCopType;
bool m_bThrowsSpikeTrap;
int32 field_624; int32 field_624;
int8 field_628; int8 field_628;

File diff suppressed because it is too large Load Diff

View File

@ -98,7 +98,6 @@ enum PedFightMoves
FIGHTMOVE_PUNCHHOOK, FIGHTMOVE_PUNCHHOOK,
FIGHTMOVE_PUNCHJAB, FIGHTMOVE_PUNCHJAB,
FIGHTMOVE_PUNCH, FIGHTMOVE_PUNCH,
FIGHTMOVE_BODYBLOW = FIGHTMOVE_PUNCH,
FIGHTMOVE_LONGKICK, FIGHTMOVE_LONGKICK,
FIGHTMOVE_ROUNDHOUSE, FIGHTMOVE_ROUNDHOUSE,
// Directionals // Directionals
@ -457,7 +456,7 @@ public:
uint32 bIsDrowning : 1; uint32 bIsDrowning : 1;
uint32 bDrownsInWater : 1; uint32 bDrownsInWater : 1;
//uint32 b156_4 //uint32 b156_4
uint32 b156_8 : 1; uint32 bHeldHostageInCar : 1;
uint32 bIsPlayerFriend : 1; uint32 bIsPlayerFriend : 1;
uint32 bHeadStuckInCollision : 1; uint32 bHeadStuckInCollision : 1;
uint32 bDeadPedInFrontOfCar : 1; uint32 bDeadPedInFrontOfCar : 1;
@ -467,7 +466,7 @@ public:
uint32 bDoomAim : 1; uint32 bDoomAim : 1;
uint32 bCanBeShotInVehicle : 1; uint32 bCanBeShotInVehicle : 1;
//uint32 b157_8 //uint32 b157_8
uint32 b157_10 : 1; uint32 bMakeFleeScream : 1;
uint32 bPushedAlongByCar : 1; uint32 bPushedAlongByCar : 1;
uint32 b157_40 : 1; uint32 b157_40 : 1;
uint32 bIgnoreThreatsBehindObjects : 1; uint32 bIgnoreThreatsBehindObjects : 1;
@ -482,7 +481,6 @@ public:
//uint32 b158_80 //uint32 b158_80
// our own flags // our own flags
uint32 m_ped_flagI40 : 1; // bMakePedsRunToPhonesToReportCrimes makes use of this as runover by car indicator
uint32 m_ped_flagI80 : 1; // KANGAROO_CHEAT define makes use of this as cheat toggle uint32 m_ped_flagI80 : 1; // KANGAROO_CHEAT define makes use of this as cheat toggle
uint8 m_gangFlags; uint8 m_gangFlags;
@ -590,8 +588,8 @@ public:
uint8 m_wepAccuracy; uint8 m_wepAccuracy;
CEntity *m_pPointGunAt; CEntity *m_pPointGunAt;
CVector m_vecHitLastPos; CVector m_vecHitLastPos;
uint32 m_curFightMove;
uint32 m_lastFightMove; uint32 m_lastFightMove;
uint32 m_lastHitState; // TODO(Miami): What's this?
uint8 m_fightButtonPressure; uint8 m_fightButtonPressure;
FightState m_fightState; FightState m_fightState;
bool m_takeAStepAfterAttack; bool m_takeAStepAfterAttack;
@ -757,6 +755,8 @@ public:
void SetWaitState(eWaitState, void*); void SetWaitState(eWaitState, void*);
bool FightStrike(CVector&, bool); bool FightStrike(CVector&, bool);
void FightHitPed(CPed*, CVector&, CVector&, int16); void FightHitPed(CPed*, CVector&, CVector&, int16);
int32 ChooseAttackPlayer(uint8, bool);
int32 ChooseAttackAI(uint8, bool);
int GetLocalDirection(const CVector2D &); int GetLocalDirection(const CVector2D &);
void StartFightDefend(uint8, uint8, uint8); void StartFightDefend(uint8, uint8, uint8);
void PlayHitSound(CPed*); void PlayHitSound(CPed*);
@ -960,6 +960,7 @@ public:
bool Dying(void) { return m_nPedState == PED_DIE; } bool Dying(void) { return m_nPedState == PED_DIE; }
bool DyingOrDead(void) { return m_nPedState == PED_DIE || m_nPedState == PED_DEAD; } bool DyingOrDead(void) { return m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }
bool OnGround(void) { return m_nPedState == PED_FALL || m_nPedState == PED_DIE || m_nPedState == PED_DEAD; } bool OnGround(void) { return m_nPedState == PED_FALL || m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }
bool OnGroundOrGettingUp(void) { return OnGround() || m_nPedState == PED_GETUP; }
bool Driving(void) { return m_nPedState == PED_DRIVING; } bool Driving(void) { return m_nPedState == PED_DRIVING; }
bool InVehicle(void) { return bInVehicle && m_pMyVehicle; } // True when ped is sitting/standing in vehicle, not in enter/exit state. bool InVehicle(void) { return bInVehicle && m_pMyVehicle; } // True when ped is sitting/standing in vehicle, not in enter/exit state.
@ -1028,6 +1029,20 @@ public:
else else
return (AnimationId)0; return (AnimationId)0;
} }
static AnimationId GetFinishingAttackAnim(CWeaponInfo* weapon) {
if (!!weapon->m_bFinish3rd)
return ANIM_MELEE_ATTACK_FINISH;
else
return (AnimationId)0;
}
static AnimationId GetSecondFireAnim(CWeaponInfo* weapon) {
if (!!weapon->m_bUse2nd)
return ANIM_WEAPON_FIRE_2ND; // or ANIM_MELEE_ATTACK_2ND
else
return (AnimationId)0;
}
// -- // --
// My additions, because there were many, many instances of that. // My additions, because there were many, many instances of that.

View File

@ -784,6 +784,7 @@ CPlayerPed::PlayerControlM16(CPad *padUsed)
GetWeapon()->Update(m_audioEntityId, nil); GetWeapon()->Update(m_audioEntityId, nil);
} }
// --MIAMI: Done
void void
CPlayerPed::PlayerControlFighter(CPad *padUsed) CPlayerPed::PlayerControlFighter(CPad *padUsed)
{ {
@ -809,6 +810,7 @@ CPlayerPed::PlayerControlFighter(CPad *padUsed)
} }
} }
// --MIAMI: Done
void void
CPlayerPed::PlayerControl1stPersonRunAround(CPad *padUsed) CPlayerPed::PlayerControl1stPersonRunAround(CPad *padUsed)
{ {

View File

@ -559,16 +559,23 @@ CPopulation::AddToPopulation(float minDist, float maxDist, float minDistOffScree
CZoneInfo zoneInfo; CZoneInfo zoneInfo;
CPed *gangLeader = nil; CPed *gangLeader = nil;
bool addCop = false; bool addCop = false;
bool forceAddingCop = false;
CPlayerInfo *playerInfo = &CWorld::Players[CWorld::PlayerInFocus]; CPlayerInfo *playerInfo = &CWorld::Players[CWorld::PlayerInFocus];
CVector playerCentreOfWorld = FindPlayerCentreOfWorld(CWorld::PlayerInFocus); CVector playerCentreOfWorld = FindPlayerCentreOfWorld(CWorld::PlayerInFocus);
CTheZones::GetZoneInfoForTimeOfDay(&playerCentreOfWorld, &zoneInfo); CTheZones::GetZoneInfoForTimeOfDay(&playerCentreOfWorld, &zoneInfo);
CWanted *wantedInfo = playerInfo->m_pPed->m_pWanted; CWanted *wantedInfo = playerInfo->m_pPed->m_pWanted;
if (wantedInfo->m_nWantedLevel > 2) { if (wantedInfo->m_nWantedLevel > 2) {
if (ms_nNumCop < wantedInfo->m_MaxCops && !playerInfo->m_pPed->bInVehicle if (!CGame::IsInInterior() && (CGeneral::GetRandomNumber() % 32 == 0) && FindPlayerVehicle())
&& (CCarCtrl::NumLawEnforcerCars >= wantedInfo->m_MaximumLawEnforcerVehicles forceAddingCop = true;
uint32 maxCops = CGame::IsInInterior() ? wantedInfo->m_MaxCops * 1.6f : wantedInfo->m_MaxCops;
if ((ms_nNumCop < maxCops || forceAddingCop) &&
(!playerInfo->m_pPed->bInVehicle &&
(CCarCtrl::NumLawEnforcerCars >= wantedInfo->m_MaximumLawEnforcerVehicles
|| CCarCtrl::NumRandomCars >= playerInfo->m_nTrafficMultiplier * CCarCtrl::CarDensityMultiplier || CCarCtrl::NumRandomCars >= playerInfo->m_nTrafficMultiplier * CCarCtrl::CarDensityMultiplier
|| CCarCtrl::NumFiretrucksOnDuty + CCarCtrl::NumAmbulancesOnDuty + CCarCtrl::NumParkedCars || CCarCtrl::NumFiretrucksOnDuty + CCarCtrl::NumAmbulancesOnDuty + CCarCtrl::NumParkedCars
+ CCarCtrl::NumMissionCars + CCarCtrl::NumLawEnforcerCars + CCarCtrl::NumRandomCars >= CCarCtrl::MaxNumberOfCarsInUse)) { + CCarCtrl::NumMissionCars + CCarCtrl::NumLawEnforcerCars + CCarCtrl::NumRandomCars >= CCarCtrl::MaxNumberOfCarsInUse) || forceAddingCop)) {
addCop = true; addCop = true;
minDist = PedCreationDistMultiplier() * MIN_CREATION_DIST; minDist = PedCreationDistMultiplier() * MIN_CREATION_DIST;
maxDist = PedCreationDistMultiplier() * (MIN_CREATION_DIST + CREATION_RANGE); maxDist = PedCreationDistMultiplier() * (MIN_CREATION_DIST + CREATION_RANGE);
@ -693,6 +700,9 @@ CPopulation::AddToPopulation(float minDist, float maxDist, float minDistOffScree
if (!farEnoughToAdd) if (!farEnoughToAdd)
break; break;
CPed *newPed = AddPed((ePedType)pedTypeToAdd, modelToAdd, generatedCoors); CPed *newPed = AddPed((ePedType)pedTypeToAdd, modelToAdd, generatedCoors);
if (forceAddingCop && newPed->m_nPedType == PEDTYPE_COP)
((CCopPed*)newPed)->m_bThrowsSpikeTrap = true;
newPed->SetWanderPath(CGeneral::GetRandomNumberInRange(0, 8)); newPed->SetWanderPath(CGeneral::GetRandomNumberInRange(0, 8));
if (i != 0) { if (i != 0) {
@ -721,10 +731,11 @@ CPopulation::AddToPopulation(float minDist, float maxDist, float minDistOffScree
} }
} }
// TODO(Miami)
CPed* CPed*
CPopulation::AddPedInCar(CVehicle* car, bool isDriver) CPopulation::AddPedInCar(CVehicle* car, bool isDriver)
{ {
int defaultModel = MI_MALE01; const int defaultModel = MI_MALE01;
int miamiViceIndex = 0; int miamiViceIndex = 0;
bool imSureThatModelIsLoaded = true; bool imSureThatModelIsLoaded = true;
CVector coors = FindPlayerCoors(); CVector coors = FindPlayerCoors();
@ -744,10 +755,6 @@ CPopulation::AddPedInCar(CVehicle* car, bool isDriver)
preferredModel = 0; preferredModel = 0;
pedType = PEDTYPE_EMERGENCY; pedType = PEDTYPE_EMERGENCY;
break; break;
case MI_FBICAR:
preferredModel = COP_FBI;
pedType = PEDTYPE_COP;
break;
case MI_POLICE: case MI_POLICE:
case MI_PREDATOR: case MI_PREDATOR:
preferredModel = COP_STREET; preferredModel = COP_STREET;
@ -762,24 +769,24 @@ CPopulation::AddPedInCar(CVehicle* car, bool isDriver)
preferredModel = COP_ARMY; preferredModel = COP_ARMY;
pedType = PEDTYPE_COP; pedType = PEDTYPE_COP;
break; break;
case MI_VICECHEE: // TODO(MIAMI): figure out new structure of the function case MI_FBIRANCH:
preferredModel = COP_MIAMIVICE; preferredModel = COP_FBI;
pedType = PEDTYPE_COP; pedType = PEDTYPE_COP;
miamiViceIndex = (isDriver ? 2 * CCarCtrl::MiamiViceCycle : 2 * CCarCtrl::MiamiViceCycle + 1);
break; break;
case MI_TAXI: default:
case MI_CABBIE: if (car->GetModelIndex() == MI_TAXI || car->GetModelIndex() == MI_CABBIE || car->GetModelIndex() == MI_ZEBRA || car->GetModelIndex() == MI_KAUFMAN) {
case MI_ZEBRA: if (isDriver) {
case MI_KAUFMAN:
if (CGeneral::GetRandomTrueFalse()) {
pedType = PEDTYPE_CIVMALE; pedType = PEDTYPE_CIVMALE;
preferredModel = MI_TAXI_D; preferredModel = MI_TAXI_D;
break; break;
} }
defaultModel = MI_TAXI_D; } else if (car->GetModelIndex() == MI_VICECHEE && car->bIsLawEnforcer) {
preferredModel = COP_MIAMIVICE;
pedType = PEDTYPE_COP;
miamiViceIndex = (isDriver ? 2 * CCarCtrl::MiamiViceCycle : 2 * CCarCtrl::MiamiViceCycle + 1);
break;
}
// fall through
default:
int gangOfPed = 0; int gangOfPed = 0;
imSureThatModelIsLoaded = false; imSureThatModelIsLoaded = false;
@ -798,9 +805,13 @@ CPopulation::AddPedInCar(CVehicle* car, bool isDriver)
if (preferredModel == -1) if (preferredModel == -1)
preferredModel = defaultModel; preferredModel = defaultModel;
if (((CPedModelInfo*)CModelInfo::GetModelInfo(preferredModel))->GetRwObject()) {
if (!car->IsPassenger(preferredModel) && !car->IsDriver(preferredModel)) {
if (((CPedModelInfo*)CModelInfo::GetModelInfo(preferredModel))->m_carsCanDrive & (1 << carModelInfo->m_vehicleClass)) if (((CPedModelInfo*)CModelInfo::GetModelInfo(preferredModel))->m_carsCanDrive & (1 << carModelInfo->m_vehicleClass))
break; break;
} }
}
}
if (i == -1) if (i == -1)
preferredModel = defaultModel; preferredModel = defaultModel;

View File

@ -70,6 +70,7 @@ bool CHud::m_Wants_To_Draw_Hud;
bool CHud::m_Wants_To_Draw_3dMarkers; bool CHud::m_Wants_To_Draw_3dMarkers;
wchar CHud::m_BigMessage[6][128]; wchar CHud::m_BigMessage[6][128];
int16 CHud::m_ItemToFlash; int16 CHud::m_ItemToFlash;
bool CHud::m_HideRadar;
// These aren't really in CHud // These aren't really in CHud
float CHud::BigMessageInUse[6]; float CHud::BigMessageInUse[6];
@ -902,8 +903,12 @@ void CHud::Draw()
/* /*
DrawRadar DrawRadar
*/ */
if (m_ItemToFlash == ITEM_RADAR && CTimer::GetFrameCounter() & 8 || m_ItemToFlash != ITEM_RADAR) { if (FrontEndMenuManager.m_PrefsRadarMode != 2 &&
!m_HideRadar && (m_ItemToFlash == ITEM_RADAR && CTimer::GetFrameCounter() & 8 || m_ItemToFlash != ITEM_RADAR)) {
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERNEAREST);
CRadar::DrawMap(); CRadar::DrawMap();
if (FrontEndMenuManager.m_PrefsRadarMode != 1) {
CRect rect(0.0f, 0.0f, SCREEN_SCALE_X(RADAR_WIDTH), SCREEN_SCALE_Y(RADAR_HEIGHT)); CRect rect(0.0f, 0.0f, SCREEN_SCALE_X(RADAR_WIDTH), SCREEN_SCALE_Y(RADAR_HEIGHT));
#ifdef FIX_BUGS #ifdef FIX_BUGS
rect.Translate(SCREEN_SCALE_X(RADAR_LEFT), SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT)); rect.Translate(SCREEN_SCALE_X(RADAR_LEFT), SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
@ -916,6 +921,7 @@ void CHud::Draw()
Sprites[HUD_RADARDISC].Draw(rect, CRGBA(0, 0, 0, 255)); Sprites[HUD_RADARDISC].Draw(rect, CRGBA(0, 0, 0, 255));
rect.Translate(0.0f, -2.0f); rect.Translate(0.0f, -2.0f);
Sprites[HUD_RADARDISC].Draw(rect, RADARDISC_COLOR); Sprites[HUD_RADARDISC].Draw(rect, RADARDISC_COLOR);
}
CRadar::DrawBlips(); CRadar::DrawBlips();
} }
} }
@ -1570,6 +1576,7 @@ void CHud::Initialise()
m_WeaponFadeTimer = 0; m_WeaponFadeTimer = 0;
m_WeaponTimer = 0; m_WeaponTimer = 0;
m_HideRadar = false;
m_LastDisplayScore = CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney; m_LastDisplayScore = CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney;
m_LastWanted = 0; m_LastWanted = 0;
@ -1617,6 +1624,7 @@ void CHud::ReInitialise() {
m_WeaponFadeTimer = 0; m_WeaponFadeTimer = 0;
m_WeaponTimer = 0; m_WeaponTimer = 0;
m_HideRadar = false;
m_LastDisplayScore = CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney; m_LastDisplayScore = CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney;
m_LastWanted = 0; m_LastWanted = 0;
} }

View File

@ -85,6 +85,7 @@ public:
static bool m_Wants_To_Draw_3dMarkers; static bool m_Wants_To_Draw_3dMarkers;
static wchar m_BigMessage[6][128]; static wchar m_BigMessage[6][128];
static int16 m_ItemToFlash; static int16 m_ItemToFlash;
static bool m_HideRadar;
// These aren't really in CHud // These aren't really in CHud
static float BigMessageInUse[6]; static float BigMessageInUse[6];

View File

@ -1349,7 +1349,7 @@ CAutomobile::ProcessControl(void)
if(!IsAlarmOn()) if(!IsAlarmOn())
ReduceHornCounter(); ReduceHornCounter();
}else{ }else{
if(UsesSiren(GetModelIndex())){ if(UsesSiren()){
if(Pads[0].bHornHistory[Pads[0].iCurrHornHistory]){ if(Pads[0].bHornHistory[Pads[0].iCurrHornHistory]){
if(Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+4) % 5] && if(Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+4) % 5] &&
Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+3) % 5]) Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+3) % 5])
@ -1559,7 +1559,7 @@ CAutomobile::ProcessControl(void)
if(m_bSirenOrAlarm && (CTimer::GetFrameCounter()&7) == 5 && if(m_bSirenOrAlarm && (CTimer::GetFrameCounter()&7) == 5 &&
UsesSiren(GetModelIndex()) && GetModelIndex() != MI_MRWHOOP) UsesSiren() && GetModelIndex() != MI_MRWHOOP)
CCarAI::MakeWayForCarWithSiren(this); CCarAI::MakeWayForCarWithSiren(this);

View File

@ -460,7 +460,7 @@ bool CCrane::DoesCranePickUpThisCarType(uint32 mi)
return mi == MI_FIRETRUCK || return mi == MI_FIRETRUCK ||
mi == MI_AMBULAN || mi == MI_AMBULAN ||
mi == MI_ENFORCER || mi == MI_ENFORCER ||
mi == MI_FBICAR || mi == MI_FBIRANCH ||
mi == MI_RHINO || mi == MI_RHINO ||
mi == MI_BARRACKS || mi == MI_BARRACKS ||
mi == MI_POLICE; mi == MI_POLICE;
@ -474,7 +474,7 @@ bool CCranes::DoesMilitaryCraneHaveThisOneAlready(uint32 mi)
case MI_FIRETRUCK: return (CarsCollectedMilitaryCrane & 1); case MI_FIRETRUCK: return (CarsCollectedMilitaryCrane & 1);
case MI_AMBULAN: return (CarsCollectedMilitaryCrane & 2); case MI_AMBULAN: return (CarsCollectedMilitaryCrane & 2);
case MI_ENFORCER: return (CarsCollectedMilitaryCrane & 4); case MI_ENFORCER: return (CarsCollectedMilitaryCrane & 4);
case MI_FBICAR: return (CarsCollectedMilitaryCrane & 8); case MI_FBIRANCH: return (CarsCollectedMilitaryCrane & 8);
case MI_RHINO: return (CarsCollectedMilitaryCrane & 0x10); case MI_RHINO: return (CarsCollectedMilitaryCrane & 0x10);
case MI_BARRACKS: return (CarsCollectedMilitaryCrane & 0x20); case MI_BARRACKS: return (CarsCollectedMilitaryCrane & 0x20);
case MI_POLICE: return (CarsCollectedMilitaryCrane & 0x40); case MI_POLICE: return (CarsCollectedMilitaryCrane & 0x40);
@ -489,7 +489,7 @@ void CCranes::RegisterCarForMilitaryCrane(uint32 mi)
case MI_FIRETRUCK: CarsCollectedMilitaryCrane |= 1; break; case MI_FIRETRUCK: CarsCollectedMilitaryCrane |= 1; break;
case MI_AMBULAN: CarsCollectedMilitaryCrane |= 2; break; case MI_AMBULAN: CarsCollectedMilitaryCrane |= 2; break;
case MI_ENFORCER: CarsCollectedMilitaryCrane |= 4; break; case MI_ENFORCER: CarsCollectedMilitaryCrane |= 4; break;
case MI_FBICAR: CarsCollectedMilitaryCrane |= 8; break; case MI_FBIRANCH: CarsCollectedMilitaryCrane |= 8; break;
case MI_RHINO: CarsCollectedMilitaryCrane |= 0x10; break; case MI_RHINO: CarsCollectedMilitaryCrane |= 0x10; break;
case MI_BARRACKS: CarsCollectedMilitaryCrane |= 0x20; break; case MI_BARRACKS: CarsCollectedMilitaryCrane |= 0x20; break;
case MI_POLICE: CarsCollectedMilitaryCrane |= 0x40; break; case MI_POLICE: CarsCollectedMilitaryCrane |= 0x40; break;

View File

@ -1512,7 +1512,7 @@ CVehicle::MakeNonDraggedPedsLeaveVehicle(CPed *ped1, CPed *ped2, CPlayerPed *&pl
for(i = 0; i < numPeds2; i++) for(i = 0; i < numPeds2; i++)
if(peds2[i]->IsFemale() || CGeneral::GetRandomTrueFalse()){ if(peds2[i]->IsFemale() || CGeneral::GetRandomTrueFalse()){
peds2[i]->m_leaveCarTimer = CTimer::GetTimeInMilliseconds() + 10000; peds2[i]->m_leaveCarTimer = CTimer::GetTimeInMilliseconds() + 10000;
peds2[i]->b156_8 = true; peds2[i]->bHeldHostageInCar = true;
peds2[i]->bFleeAfterExitingCar = true; peds2[i]->bFleeAfterExitingCar = true;
} }
} }
@ -1557,9 +1557,9 @@ CVehicle::IsLawEnforcementVehicle(void)
} }
bool bool
CVehicle::UsesSiren(uint32 id) CVehicle::UsesSiren(void)
{ {
switch(id){ switch(GetModelIndex()){
case MI_FIRETRUCK: case MI_FIRETRUCK:
case MI_AMBULAN: case MI_AMBULAN:
case MI_FBICAR: case MI_FBICAR:

View File

@ -345,7 +345,7 @@ public:
int FindTyreNearestPoint(float x, float y); int FindTyreNearestPoint(float x, float y);
bool IsLawEnforcementVehicle(void); bool IsLawEnforcementVehicle(void);
void ChangeLawEnforcerState(uint8 enable); void ChangeLawEnforcerState(uint8 enable);
bool UsesSiren(uint32 id); bool UsesSiren(void);
bool IsVehicleNormal(void); bool IsVehicleNormal(void);
bool CarHasRoof(void); bool CarHasRoof(void);
bool IsUpsideDown(void); bool IsUpsideDown(void);