summaryrefslogtreecommitdiffstats
path: root/src/weapons/Explosion.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/weapons/Explosion.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/weapons/Explosion.cpp b/src/weapons/Explosion.cpp
index d0a68279..5d4b8f80 100644
--- a/src/weapons/Explosion.cpp
+++ b/src/weapons/Explosion.cpp
@@ -31,6 +31,16 @@ void
CExplosion::Initialise()
{
debug("Initialising CExplosion...\n");
+ ClearAllExplosions();
+ AudioHandle = DMAudio.CreateEntity(AUDIOTYPE_EXPLOSION, (void*)1);
+ if (AudioHandle >= 0)
+ DMAudio.SetEntityStatus(AudioHandle, true);
+ debug("CExplosion ready\n");
+}
+
+void
+CExplosion::ClearAllExplosions()
+{
for (int i = 0; i < ARRAY_SIZE(gaExplosion); i++) {
gaExplosion[i].m_ExplosionType = EXPLOSION_GRENADE;
gaExplosion[i].m_vecPosition = CVector(0.0f, 0.0f, 0.0f);
@@ -44,10 +54,6 @@ CExplosion::Initialise()
gaExplosion[i].m_fStartTime = 0.0f;
gaExplosion[i].m_bIsBoat = false;
}
- AudioHandle = DMAudio.CreateEntity(AUDIOTYPE_EXPLOSION, (void*)1);
- if (AudioHandle >= 0)
- DMAudio.SetEntityStatus(AudioHandle, true);
- debug("CExplosion ready\n");
}
void
@@ -86,7 +92,7 @@ CExplosion::GetExplosionPosition(uint8 id)
}
bool
-CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime)
+CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool unk)
{
CVector pPosn;
CVector posGround;
@@ -170,6 +176,7 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT
break;
case EXPLOSION_CAR:
case EXPLOSION_CAR_QUICK:
+ case EXPLOSION_BOAT:
explosion.m_fRadius = 9.0f;
explosion.m_fPower = 300.0f;
explosion.m_fStopTime = lifetime + CTimer::GetTimeInMilliseconds() + 4250;
@@ -205,6 +212,7 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT
}
break;
case EXPLOSION_HELI:
+ case EXPLOSION_HELI2:
explosion.m_fRadius = 6.0f;
explosion.m_fPower = 300.0f;
explosion.m_fStopTime = lifetime + CTimer::GetTimeInMilliseconds() + 750;