Merge branch 'miami' of https://github.com/GTAmodding/re3 into miami_highfps

This commit is contained in:
Veyrdite 2021-07-23 15:08:42 +10:00
commit c87654ec77
5 changed files with 17 additions and 9 deletions

View File

@ -2955,7 +2955,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
CPed *pPed = params.m_pVehicle->pDriver; CPed *pPed = params.m_pVehicle->pDriver;
if(!pPed) if(!pPed)
break; break;
if(!pPed->HasWeaponSlot(WEAPONSLOT_SUBMACHINEGUN)) { if(!pPed->HasWeaponSlot(WEAPONSLOT_SUBMACHINEGUN) || (params.m_pVehicle->GetModelIndex() == MI_PREDATOR && !pPed->IsPedDoingDriveByShooting())) {
sampleIndex = SFX_UZI_LEFT; sampleIndex = SFX_UZI_LEFT;
frequency = SampleManager.GetSampleBaseFrequency(sampleIndex); frequency = SampleManager.GetSampleBaseFrequency(sampleIndex);
frequency += RandomDisplacement(frequency / 32); frequency += RandomDisplacement(frequency / 32);

View File

@ -1913,7 +1913,7 @@ bool CRunningScript::CheckDamagedWeaponType(int32 actual, int32 type)
if (type == WEAPONTYPE_ANYMELEE) { if (type == WEAPONTYPE_ANYMELEE) {
if (actual <= WEAPONTYPE_CHAINSAW) if (actual <= WEAPONTYPE_CHAINSAW)
return true; return true;
if (actual - WEAPONTYPE_GRENADE <= WEAPONTYPE_MINIGUN) if (actual >= WEAPONTYPE_GRENADE && actual <= WEAPONTYPE_UNIDENTIFIED)
return false; return false;
return false; return false;
} }

View File

@ -2362,12 +2362,12 @@ CPed::ProcessControl(void)
} else { } else {
obstacleForFlyingOtherDirZ = 501.0f; obstacleForFlyingOtherDirZ = 501.0f;
} }
uint8 flyDir = 0; int16 flyDir = 0;
float feetZ = GetPosition().z - FEET_OFFSET; float feetZ = GetPosition().z - FEET_OFFSET;
#ifdef FIX_BUGS #ifdef FIX_BUGS
if (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f) if (obstacleForFlyingZ > feetZ && obstacleForFlyingZ < 500.0f)
flyDir = 1; flyDir = 1;
else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 500.0f) else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f)
flyDir = 2; flyDir = 2;
#else #else
if ((obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 500.0f) || (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ > feetZ)) if ((obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 500.0f) || (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ > feetZ))
@ -2376,8 +2376,8 @@ CPed::ProcessControl(void)
flyDir = 2; flyDir = 2;
#endif #endif
if (flyDir != 0 && !bHeadStuckInCollision) { if (flyDir > 0 && !bHeadStuckInCollision) {
SetPosition((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point)); GetMatrix().SetTranslateOnly(flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point);
GetMatrix().GetPosition().z += FEET_OFFSET; GetMatrix().GetPosition().z += FEET_OFFSET;
GetMatrix().UpdateRW(); GetMatrix().UpdateRW();
SetLanding(); SetLanding();
@ -3009,7 +3009,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
lowerSpeedLimit *= 1.5f; lowerSpeedLimit *= 1.5f;
} }
CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL); CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL);
if (!bWasStanding && speed > upperSpeedLimit && (!bPushedAlongByCar || m_vecMoveSpeed.z < lowerSpeedLimit) if (!bWasStanding && ((speed > upperSpeedLimit && !bPushedAlongByCar) || (m_vecMoveSpeed.z < lowerSpeedLimit))
&& m_pCollidingEntity != collidingEnt) { && m_pCollidingEntity != collidingEnt) {
float damage = 100.0f * Max(speed - 0.25f, 0.0f); float damage = 100.0f * Max(speed - 0.25f, 0.0f);

View File

@ -352,6 +352,14 @@ CPed::SetAttack(CEntity *victim)
SetAimFlag(m_fRotationCur); SetAimFlag(m_fRotationCur);
} }
} }
#ifdef FIX_BUGS
// fix aiming for flamethrower and minigun while using PC controls
else if (curWeapon->m_AnimToPlay == ASSOCGRP_FLAMETHROWER && TheCamera.Cams[0].Using3rdPersonMouseCam() && this == FindPlayerPed())
{
SetAimFlag(m_fRotationCur);
((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch();
}
#endif
if (m_nPedState == PED_ATTACK) { if (m_nPedState == PED_ATTACK) {
bIsAttacking = true; bIsAttacking = true;
return; return;

View File

@ -3182,7 +3182,7 @@ bool
CPed::IsPedDoingDriveByShooting(void) CPed::IsPedDoingDriveByShooting(void)
{ {
#ifdef FIX_BUGS #ifdef FIX_BUGS
if (FindPlayerPed() == this && CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_nWeaponSlot == 5) { if (FindPlayerPed() == this && CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_nWeaponSlot == WEAPONSLOT_SUBMACHINEGUN) {
#else #else
if (FindPlayerPed() == this && GetWeapon()->m_eWeaponType == WEAPONTYPE_UZI) { if (FindPlayerPed() == this && GetWeapon()->m_eWeaponType == WEAPONTYPE_UZI) {
#endif #endif