diff options
author | Nikolay <nickvnuk@gmail.com> | 2021-08-31 22:16:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-31 22:16:52 +0200 |
commit | 9bd80324d1ff3f221304a7dde98358d9895926c2 (patch) | |
tree | 7f2b08583a71f159faa69b4254b54e4fac55174c /src/control/Garages.cpp | |
parent | Bridge sound done (diff) | |
parent | fix compile (diff) | |
download | re3-9bd80324d1ff3f221304a7dde98358d9895926c2.tar re3-9bd80324d1ff3f221304a7dde98358d9895926c2.tar.gz re3-9bd80324d1ff3f221304a7dde98358d9895926c2.tar.bz2 re3-9bd80324d1ff3f221304a7dde98358d9895926c2.tar.lz re3-9bd80324d1ff3f221304a7dde98358d9895926c2.tar.xz re3-9bd80324d1ff3f221304a7dde98358d9895926c2.tar.zst re3-9bd80324d1ff3f221304a7dde98358d9895926c2.zip |
Diffstat (limited to 'src/control/Garages.cpp')
-rw-r--r-- | src/control/Garages.cpp | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index c4916878..dd9067fc 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -627,13 +627,24 @@ void CGarage::Update() case GS_OPENED: UpdateDoorsHeight(); if (IsStaticPlayerCarEntirelyInside()) { +#ifndef BOMBS_ON_BIKES if (FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_APPEARANCE_BIKE) { CGarages::TriggerMessage("GA_22", -1, 4000, -1); m_eGarageState = GS_OPENEDCONTAINSCAR; DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB_ALREADY_SET, 1); break; } - if (!FindPlayerVehicle() || FindPlayerVehicle()->m_bombType) { +#endif + if (!FindPlayerVehicle() +#ifdef FIX_BUGS + || (FindPlayerVehicle()->IsCar() && ((CAutomobile*)FindPlayerVehicle())->m_bombType) +#else + || ((CAutomobile*)FindPlayerVehicle())->m_bombType +#endif +#ifdef BOMBS_ON_BIKES + || (FindPlayerVehicle()->IsBike() && ((CBike*)FindPlayerVehicle())->m_bombType) +#endif + ) { CGarages::TriggerMessage("GA_5", -1, 4000, -1); //"Your car is already fitted with a bomb" m_eGarageState = GS_OPENEDCONTAINSCAR; DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB_ALREADY_SET, 1); @@ -677,10 +688,16 @@ void CGarage::Update() if (!CGarages::BombsAreFree) CWorld::Players[CWorld::PlayerInFocus].m_nMoney = Max(0, CWorld::Players[CWorld::PlayerInFocus].m_nMoney - BOMB_PRICE); if (FindPlayerVehicle() && (FindPlayerVehicle()->IsCar() || FindPlayerVehicle()->IsBike())) { -#if (!defined GTA_PS2 || defined FIX_BUGS) // <- this remained in CAutomobile in LCS - FindPlayerVehicle()->m_bombType = CGarages::GetBombTypeForGarageType(m_eGarageType); - FindPlayerVehicle()->m_pBombRigger = FindPlayerPed(); -#else // PS2 version contained a bug: CBike was casted to CAutomobile, but due to coincidence it didn't corrupt memory +#ifdef BOMBS_ON_BIKES + if (FindPlayerVehicle()->IsCar()) { + ((CAutomobile*)(FindPlayerVehicle()))->m_bombType = CGarages::GetBombTypeForGarageType(m_eGarageType); + ((CAutomobile*)(FindPlayerVehicle()))->m_pBombRigger = FindPlayerPed(); + } + else { + ((CBike*)(FindPlayerVehicle()))->m_bombType = CGarages::GetBombTypeForGarageType(m_eGarageType); + ((CBike*)(FindPlayerVehicle()))->m_pBombRigger = FindPlayerPed(); + } +#else ((CAutomobile*)(FindPlayerVehicle()))->m_bombType = CGarages::GetBombTypeForGarageType(m_eGarageType); ((CAutomobile*)(FindPlayerVehicle()))->m_pBombRigger = FindPlayerPed(); #endif @@ -694,6 +711,13 @@ void CGarage::Update() pCar->m_pBombRigger = nil; pCar->m_pBlowUpEntity = nil; } +#ifdef BOMBS_ON_BIKES + if (pVehicle->IsBike() && pVehicle->GetStatus() == STATUS_WRECKED) { + CBike* pBike = (CBike*)pVehicle; + pBike->m_pBombRigger = nil; + pBike->m_pBlowUpEntity = nil; + } +#endif } } if (m_eGarageType == GARAGE_BOMBSHOP3) |