summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--src/audio/AudioLogic.cpp1
-rw-r--r--src/control/TrafficLights.cpp2
-rw-r--r--src/peds/Ped.cpp6
-rw-r--r--src/peds/PedIK.h2
-rw-r--r--src/peds/PlayerPed.cpp23
-rw-r--r--src/weapons/Weapon.cpp26
6 files changed, 57 insertions, 3 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index d94a98c8..647c2fb0 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -4316,6 +4316,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
m_sQueueSample.m_nFrequency = 20000;
goto AddFightSound;
case SOUND_FIGHT_40:
+ case SOUND_186:
m_sQueueSample.m_nSampleIndex = SFX_FIGHT_2;
m_sQueueSample.m_nFrequency = 18000;
goto AddFightSound;
diff --git a/src/control/TrafficLights.cpp b/src/control/TrafficLights.cpp
index d8f211d0..a3cba9b9 100644
--- a/src/control/TrafficLights.cpp
+++ b/src/control/TrafficLights.cpp
@@ -303,7 +303,7 @@ CTrafficLights::DisplayActualLight(CEntity *ent)
12.0f, 1.0f, 40.0f, false, 0.0f);
if (id >= 0) {
- if (DotProduct(TheCamera.GetForward(), ent->GetForward()) < 0.0f)
+ if (DotProduct(TheCamera.GetForward(), ent->GetForward()) > 0.0f)
CCoronas::RegisterCorona((uintptr)ent + id,
r * CTimeCycle::GetSpriteBrightness() * 0.7f,
g * CTimeCycle::GetSpriteBrightness() * 0.7f,
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index c0b1af23..e284dad5 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -7291,6 +7291,9 @@ CPed::SetAnswerMobile(void)
{
if (m_nPedState != PED_ANSWER_MOBILE && !DyingOrDead()) {
SetPedState(PED_ANSWER_MOBILE);
+#ifdef FIX_BUGS
+ ClearLookFlag();
+#endif
RemoveWeaponAnims(GetWeapon()->m_eWeaponType, -4.0f);
CAnimBlendAssociation *assoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_PHONE_IN, 4.0f);
assoc->SetFinishCallback(StartTalkingOnMobileCB, this);
@@ -7298,6 +7301,9 @@ CPed::SetAnswerMobile(void)
if (m_storedWeapon == WEAPONTYPE_UNIDENTIFIED)
m_storedWeapon = GetWeapon()->m_eWeaponType;
+#ifdef FIX_BUGS
+ SetCurrentWeapon(0);
+#endif
RemoveWeaponModel(-1);
}
}
diff --git a/src/peds/PedIK.h b/src/peds/PedIK.h
index 8be04365..3011dd5f 100644
--- a/src/peds/PedIK.h
+++ b/src/peds/PedIK.h
@@ -29,7 +29,7 @@ class CPedIK
{
public:
enum {
- GUN_POINTED_SUCCESSFULLY = 1, // set but unused
+ GUN_POINTED_SUCCESSFULLY = 1,
LOOKAROUND_HEAD_ONLY = 2,
AIMS_WITH_ARM = 4,
};
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 047eae10..88c1e6bf 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -574,8 +574,12 @@ CPlayerPed::DoWeaponSmoothSpray(void)
return -1.0f;
case WEAPONTYPE_CHAINSAW:
- if (GetMeleeStartAnim(weaponInfo) && RpAnimBlendClumpGetAssociation(GetClump(), GetMeleeStartAnim(weaponInfo)))
+ if (GetMeleeStartAnim(weaponInfo) && RpAnimBlendClumpGetAssociation(GetClump(), GetMeleeStartAnim(weaponInfo))) {
+#ifdef FREE_CAM
+ if (TheCamera.Cams[0].Using3rdPersonMouseCam()) return -1.0f;
+#endif
return PI / 128.0f;
+ }
else if (GetFireAnimGround(weaponInfo, false) && RpAnimBlendClumpGetAssociation(GetClump(), GetFireAnimGround(weaponInfo, false)))
return PI / 176.f;
else
@@ -1222,11 +1226,21 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
}
if (padUsed->DuckJustDown() && !bIsDucking && m_nMoveState != PEDMOVE_SPRINT) {
+#ifdef FIX_BUGS
+ // fix tommy being locked into looking at the same spot if you duck just after starting to shoot
+ if(!m_pPointGunAt)
+ ClearPointGunAt();
+#endif
bCrouchWhenShooting = true;
SetDuck(60000, true);
} else if (bIsDucking && (padUsed->DuckJustDown() || m_nMoveState == PEDMOVE_SPRINT ||
padUsed->GetSprint() || padUsed->JumpJustDown() || padUsed->ExitVehicleJustDown())) {
+#ifdef FIX_BUGS
+ // same fix as above except for standing up
+ if(!m_pPointGunAt)
+ ClearPointGunAt();
+#endif
ClearDuck(true);
bCrouchWhenShooting = false;
}
@@ -1466,6 +1480,13 @@ CPlayerPed::PlayerControlZelda(CPad *padUsed)
padMoveInGameUnit = CVector2D(leftRight, upDown).Magnitude() / PAD_MOVE_TO_GAME_WORLD_MOVE;
}
+#ifdef FREE_CAM
+ if (TheCamera.Cams[0].Using3rdPersonMouseCam() && smoothSprayRate > 0.0f) {
+ padMoveInGameUnit = 0.0f;
+ smoothSprayWithoutMove = false;
+ }
+#endif
+
if (padMoveInGameUnit > 0.0f || smoothSprayWithoutMove) {
float padHeading = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown);
float neededTurn = CGeneral::LimitRadianAngle(padHeading - camOrientation);
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;