summaryrefslogtreecommitdiffstats
path: root/src/weapons
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/weapons/Explosion.cpp19
-rw-r--r--src/weapons/Explosion.h2
2 files changed, 11 insertions, 10 deletions
diff --git a/src/weapons/Explosion.cpp b/src/weapons/Explosion.cpp
index 189dc57a..d53e15ca 100644
--- a/src/weapons/Explosion.cpp
+++ b/src/weapons/Explosion.cpp
@@ -25,6 +25,9 @@ CExplosion gaExplosion[NUM_EXPLOSIONS];
RwRGBA colMedExpl = { 0, 0, 0, 0 };
RwRGBA colUpdate = { 0, 0, 0, 0 };
+const RwRGBA colAddExplosion = { 160, 160, 160, 255 };
+const RwRGBA colGrenade = { 96, 96, 96, 255 };
+
int AudioHandle = AEHANDLE_NONE;
void
@@ -99,15 +102,14 @@ CExplosion::GetExplosionPosition(uint8 id)
}
bool
-CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool isMakeSound)
+CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool makeSound)
{
- const RwRGBA color = { 160, 160, 160, 255 };
- const RwRGBA colorGrenade = { 96, 96, 96, 255 };
-
CVector pPosn;
CVector posGround;
RwRGBA colorMedium = colMedExpl;
+ RwRGBA color = colAddExplosion;
+ RwRGBA colorGrenade = colGrenade;
bool bDontExplode = false;
pPosn = pos;
pPosn.z += 5.0f;
@@ -138,7 +140,7 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT
explosion.m_nIteration = 1;
explosion.m_nActiveCounter = 1;
explosion.m_bIsBoat = false;
- explosion.m_bIsMakeSound = true;
+ explosion.m_bIsMakeSound = makeSound;
explosion.m_nParticlesExpireTime = lifetime != 0 ? CTimer::GetTimeInMilliseconds() + lifetime : 0;
switch (type)
{
@@ -152,10 +154,9 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT
CEventList::RegisterEvent(EVENT_EXPLOSION, posGround, 250);
if (Distance(explosion.m_vecPosition, TheCamera.GetPosition()) < 40.0f) {
uint8 tmp = CGeneral::GetRandomNumberInRange(0, 64) - 64;
- RwRGBA tmpColor = colorGrenade;
- tmpColor.green += tmp;
- tmpColor.blue += tmp;
- CParticle::AddParticle(PARTICLE_EXPLOSION_LFAST, explosion.m_vecPosition, CVector(0.0f, 0.0f, 0.0f), nil, 4.5f, tmpColor);
+ colorGrenade.green += tmp;
+ colorGrenade.blue += tmp;
+ CParticle::AddParticle(PARTICLE_EXPLOSION_LFAST, explosion.m_vecPosition, CVector(0.0f, 0.0f, 0.0f), nil, 4.5f, colorGrenade);
}
break;
case EXPLOSION_MOLOTOV:
diff --git a/src/weapons/Explosion.h b/src/weapons/Explosion.h
index f99cb670..8fbfe63e 100644
--- a/src/weapons/Explosion.h
+++ b/src/weapons/Explosion.h
@@ -37,7 +37,7 @@ class CExplosion
float m_fPower;
float m_fZshift;
public:
- static bool AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool isMakeSound = true); //done(new parametr in android ver is fix for one mission)
+ static bool AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool makeSound = true); //done(new parametr in android ver is fix for one mission)
static void ClearAllExplosions(); //done
static bool DoesExplosionMakeSound(uint8 id); //done
static int8 GetExplosionActiveCounter(uint8 id); //done