diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2021-08-29 18:32:22 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2021-08-29 18:32:22 +0200 |
commit | 453f8c05a4fc2ef03ba1d4f7bac43ba871c52fbd (patch) | |
tree | b1586ab27437633e49c795c2e1277f6ca4877cfa /src/vehicles/Bike.cpp | |
parent | fix (diff) | |
download | re3-453f8c05a4fc2ef03ba1d4f7bac43ba871c52fbd.tar re3-453f8c05a4fc2ef03ba1d4f7bac43ba871c52fbd.tar.gz re3-453f8c05a4fc2ef03ba1d4f7bac43ba871c52fbd.tar.bz2 re3-453f8c05a4fc2ef03ba1d4f7bac43ba871c52fbd.tar.lz re3-453f8c05a4fc2ef03ba1d4f7bac43ba871c52fbd.tar.xz re3-453f8c05a4fc2ef03ba1d4f7bac43ba871c52fbd.tar.zst re3-453f8c05a4fc2ef03ba1d4f7bac43ba871c52fbd.zip |
Diffstat (limited to 'src/vehicles/Bike.cpp')
-rw-r--r-- | src/vehicles/Bike.cpp | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/vehicles/Bike.cpp b/src/vehicles/Bike.cpp index 60530fff..d8ad71ea 100644 --- a/src/vehicles/Bike.cpp +++ b/src/vehicles/Bike.cpp @@ -37,6 +37,7 @@ #include "Bike.h" #include "Debug.h" #include "SaveBuf.h" +#include "Garages.h" const uint32 CBike::nSaveStructSize = #ifdef COMPATIBLE_SAVES @@ -232,7 +233,19 @@ CBike::ProcessControl(void) ProcessCarAlarm(); - ActivateBombWhenEntered(); + if (pDriver) { + if (!bDriverLastFrame && m_bombType == CARBOMB_ONIGNITIONACTIVE) { + // If someone enters the car and there is a bomb, detonate + m_nBombTimer = 1000; + m_pBlowUpEntity = m_pBombRigger; + if (m_pBlowUpEntity) + m_pBlowUpEntity->RegisterReference((CEntity**)&m_pBlowUpEntity); + DMAudio.PlayOneShot(m_audioEntityId, SOUND_BOMB_TICK, 1.0f); + } + bDriverLastFrame = true; + } + else + bDriverLastFrame = false; CRubbish::StirUp(this); @@ -300,8 +313,23 @@ CBike::ProcessControl(void) ApplyMoveForce(parallelSpeed * -CTimer::GetTimeStep()*SAND_SLOWDOWN*m_fMass); } } - if(CPad::GetPad(0)->WeaponJustDown()) - ActivateBomb(); + +#ifdef BOMBS_ON_BIKES + if(CPad::GetPad(0)->WeaponJustDown()) { + if (m_bombType == CARBOMB_TIMED) { + m_bombType = CARBOMB_TIMEDACTIVE; + m_nBombTimer = 7000; + m_pBlowUpEntity = FindPlayerPed(); + CGarages::TriggerMessage("GA_12", -1, 3000, -1); + DMAudio.PlayOneShot(m_audioEntityId, SOUND_BOMB_TIMED_ACTIVATED, 1.0f); + } + else if (m_bombType == CARBOMB_ONIGNITION) { + m_bombType = CARBOMB_ONIGNITIONACTIVE; + CGarages::TriggerMessage("GA_12", -1, 3000, -1); + DMAudio.PlayOneShot(m_audioEntityId, SOUND_BOMB_ONIGNITION_ACTIVATED, 1.0f); + } + } +#endif break; case STATUS_PLAYER_PLAYBACKFROMBUFFER: |