summaryrefslogtreecommitdiffstats
path: root/src/weapons/Weapon.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-27 19:58:17 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-27 19:58:17 +0200
commit6dc8c5bd92dc031afa3ba9b6e1149dbbba338598 (patch)
treeb91cd2317cef091e9321b44157ef519f33bfbc45 /src/weapons/Weapon.cpp
parentLaw enforcers and generic female ped comments (diff)
parentFix stuck looking flag when answering phone and idle weapon animation (diff)
downloadre3-6dc8c5bd92dc031afa3ba9b6e1149dbbba338598.tar
re3-6dc8c5bd92dc031afa3ba9b6e1149dbbba338598.tar.gz
re3-6dc8c5bd92dc031afa3ba9b6e1149dbbba338598.tar.bz2
re3-6dc8c5bd92dc031afa3ba9b6e1149dbbba338598.tar.lz
re3-6dc8c5bd92dc031afa3ba9b6e1149dbbba338598.tar.xz
re3-6dc8c5bd92dc031afa3ba9b6e1149dbbba338598.tar.zst
re3-6dc8c5bd92dc031afa3ba9b6e1149dbbba338598.zip
Diffstat (limited to '')
-rw-r--r--src/weapons/Weapon.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index bac82588..f31e0c60 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -932,11 +932,37 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false);
CWorld::bIncludeBikers = false;
}
+#ifdef FIX_BUGS
+ // fix muzzleflash rotation
+ heading = CGeneral::GetAngleBetweenPoints(source.x, source.y, target.x, target.y);
+ angle = DEGTORAD(heading);
+
+ ahead = CVector2D(-Sin(angle), Cos(angle));
+ ahead.Normalise();
+#endif
}
else if ( shooter == FindPlayerPed() && TheCamera.Cams[0].Using3rdPersonMouseCam() )
{
TheCamera.Find3rdPersonCamTargetVector(info->m_fRange, *fireSource, source, target);
+#ifdef FREE_CAM
+ CPed *shooterPed = (CPed *)shooter;
+ if((shooterPed->m_pedIK.m_flags & CPedIK::GUN_POINTED_SUCCESSFULLY) == 0) {
+ target.x = info->m_fRange;
+ target.y = 0.0f;
+ target.z = 0.0f;
+ shooterPed->TransformToNode(target, PED_HANDR);
+ }
+#endif
+
+#ifdef FIX_BUGS
+ // fix muzzleflash rotation
+ heading = CGeneral::GetAngleBetweenPoints(source.x, source.y, target.x, target.y);
+ angle = DEGTORAD(heading);
+
+ ahead = CVector2D(-Sin(angle), Cos(angle));
+ ahead.Normalise();
+#endif
CWorld::bIncludeBikers = true;
CWorld::bIncludeDeadPeds = true;
CWorld::bIncludeCarTyres = true;