From a510a03b8a6bf16ddffb71ff1e374a21b7ab24f2 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sun, 25 Jul 2021 22:27:00 +0300 Subject: Small fix --- src/audio/AudioLogic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 6c53eb10..cff04eae 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -5245,7 +5245,7 @@ cAudioManager::GetPedCommentSfx(CPed *ped, int32 sound) case MI_COP: return GetCopTalkSfx(ped, sound); case MI_SWAT: return GetSwatTalkSfx(ped, sound); case MI_FBI: return GetFBITalkSfx(ped, sound); - case MI_ARMY: return GetGenericMaleTalkSfx(ped, sound); + case MI_ARMY: return GetArmyTalkSfx(ped, sound); case MI_MEDIC: return GetMedicTalkSfx(ped, sound); case MI_FIREMAN: return GetFiremanTalkSfx(ped, sound); case MI_MALE01: return GetDefaultTalkSfx(ped, sound); -- cgit v1.2.3 From ed9c911a0e0c0120e54166948d60c9efb01c1939 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 26 Jul 2021 04:40:23 +0300 Subject: Fix traffic light corona facing wrong side --- src/control/TrafficLights.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/control/TrafficLights.cpp b/src/control/TrafficLights.cpp index df0761ab..e484d3be 100644 --- a/src/control/TrafficLights.cpp +++ b/src/control/TrafficLights.cpp @@ -277,7 +277,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, -- cgit v1.2.3 From 1aac4d802f6cb12c35b877838c425c95fa92aea4 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 26 Jul 2021 07:41:34 +0300 Subject: Fix Tommy looking at one spot due to crouching + shooting --- src/peds/PlayerPed.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp index 8225189f..d96cb683 100644 --- a/src/peds/PlayerPed.cpp +++ b/src/peds/PlayerPed.cpp @@ -1221,11 +1221,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; } -- cgit v1.2.3 From 123f2fda9bb358fd1fcf56616b1587441494f580 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 26 Jul 2021 08:22:57 +0300 Subject: Fix ridiculously accurate bullets when you shoot behind with enabled free camera --- src/weapons/Weapon.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index d4cb1cbe..4fba3c67 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -936,6 +936,16 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource) 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 CWorld::bIncludeBikers = true; CWorld::bIncludeDeadPeds = true; -- cgit v1.2.3 From f7a2c265b3cb7a9716c02a6a94cd98a7a8231143 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 26 Jul 2021 09:16:20 +0300 Subject: Remove deceiving comment --- src/peds/PedIK.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, }; -- cgit v1.2.3 From 250727c9ca75292e5404d31f08e21146e7ad43b6 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 26 Jul 2021 09:52:39 +0300 Subject: Fix muzzleflash rotation --- src/weapons/Weapon.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index 4fba3c67..8328067f 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -932,6 +932,14 @@ 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() ) { @@ -947,6 +955,14 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource) } #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; -- cgit v1.2.3 From 371f1be9b3adcb5fb6caeba62a411687c2059316 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 26 Jul 2021 09:54:04 +0300 Subject: Fix smooth spray when using chainsaw or when you stop shooting while using free camera and PC controls --- src/peds/PlayerPed.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp index d96cb683..1d96ba6d 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 @@ -1475,6 +1479,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); -- cgit v1.2.3 From 1180f32d9c21f7d06d2d45a03303d1870ce7294b Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 26 Jul 2021 11:33:56 +0300 Subject: Fix bike kick sound --- src/audio/AudioLogic.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index cff04eae..f9de1793 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -4289,6 +4289,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) 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; -- cgit v1.2.3 From c0488b3190d1c5c9509b848cddab5e9a46f0a2e6 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 26 Jul 2021 20:40:55 +0300 Subject: Fix stuck looking flag when answering phone and idle weapon animation --- src/peds/Ped.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 002cbe3b..eadd9d64 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); } } -- cgit v1.2.3