diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-05-12 03:31:11 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-05-12 03:31:11 +0200 |
commit | 8f1a2825d4126f87ec695132dc6ee080a652a1fa (patch) | |
tree | b85bd70499691d93f59a75f900935ecf0dc5da28 /src | |
parent | Update README.md (diff) | |
download | re3-8f1a2825d4126f87ec695132dc6ee080a652a1fa.tar re3-8f1a2825d4126f87ec695132dc6ee080a652a1fa.tar.gz re3-8f1a2825d4126f87ec695132dc6ee080a652a1fa.tar.bz2 re3-8f1a2825d4126f87ec695132dc6ee080a652a1fa.tar.lz re3-8f1a2825d4126f87ec695132dc6ee080a652a1fa.tar.xz re3-8f1a2825d4126f87ec695132dc6ee080a652a1fa.tar.zst re3-8f1a2825d4126f87ec695132dc6ee080a652a1fa.zip |
Diffstat (limited to '')
-rw-r--r-- | src/weapons/Weapon.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index aef53094..e40deb61 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -997,9 +997,13 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim, for ( int32 i = 0; i < 16; i++ ) CParticle::AddParticle(PARTICLE_SPARK, point->point, point->normal*0.05f); - CVector dist = point->point - (*source); - CVector offset = dist - Max(0.2f*dist.Magnitude(), 2.0f) * CVector(ahead.x, ahead.y, 0.0f); - CVector smokePos = *source + offset; +#ifndef FIX_BUGS + CVector dist = point->point - (*source); + CVector offset = dist - Max(0.2f * dist.Magnitude(), 2.0f) * CVector(ahead.x, ahead.y, 0.0f); + CVector smokePos = *source + offset; +#else + CVector smokePos = point->point; +#endif // !FIX_BUGS smokePos.x += CGeneral::GetRandomNumberInRange(-0.2f, 0.2f); smokePos.y += CGeneral::GetRandomNumberInRange(-0.2f, 0.2f); @@ -1016,9 +1020,13 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim, for ( int32 i = 0; i < 16; i++ ) CParticle::AddParticle(PARTICLE_SPARK, point->point, point->normal*0.05f); +#ifndef FIX_BUGS CVector dist = point->point - (*source); CVector offset = dist - Max(0.2f*dist.Magnitude(), 0.5f) * CVector(ahead.x, ahead.y, 0.0f); - CVector smokePos = *source + offset; + CVector smokePos = *source + offset; +#else + CVector smokePos = point->point; +#endif // !FIX_BUGS CParticle::AddParticle(PARTICLE_BULLETHIT_SMOKE, smokePos, CVector(0.0f, 0.0f, 0.0f)); @@ -1265,9 +1273,13 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource) for ( int32 i = 0; i < 16; i++ ) CParticle::AddParticle(PARTICLE_SPARK, point.point, point.normal*0.05f); +#ifndef FIX_BUGS CVector dist = point.point - (*fireSource); CVector offset = dist - Max(0.2f*dist.Magnitude(), 2.0f) * CVector(shootRot.x, shootRot.y, 0.0f); CVector smokePos = *fireSource + offset; +#else + CVector smokePos = point.point; +#endif CParticle::AddParticle(PARTICLE_BULLETHIT_SMOKE, smokePos, CVector(0.0f, 0.0f, 0.0f)); @@ -1280,9 +1292,13 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource) for ( int32 i = 0; i < 16; i++ ) CParticle::AddParticle(PARTICLE_SPARK, point.point, point.normal*0.05f); +#ifndef FIX_BUGS CVector dist = point.point - (*fireSource); CVector offset = dist - Max(0.2f*dist.Magnitude(), 2.0f) * CVector(shootRot.x, shootRot.y, 0.0f); - CVector smokePos = *fireSource + offset; + CVector smokePos = *fireSource + offset; +#else + CVector smokePos = point.point; +#endif smokePos.x += CGeneral::GetRandomNumberInRange(-0.2f, 0.2f); smokePos.y += CGeneral::GetRandomNumberInRange(-0.2f, 0.2f); |