summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Bike.cpp
diff options
context:
space:
mode:
authorNikolay <nickvnuk@gmail.com>2021-08-31 22:16:52 +0200
committerGitHub <noreply@github.com>2021-08-31 22:16:52 +0200
commit9bd80324d1ff3f221304a7dde98358d9895926c2 (patch)
tree7f2b08583a71f159faa69b4254b54e4fac55174c /src/vehicles/Bike.cpp
parentBridge sound done (diff)
parentfix compile (diff)
downloadre3-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/vehicles/Bike.cpp')
-rw-r--r--src/vehicles/Bike.cpp34
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: