Merge branch 'miami' into lcs

# Conflicts:
#	premake5.lua
#	src/audio/AudioLogic.cpp
#	src/audio/AudioManager.cpp
This commit is contained in:
Sergeanur
2021-08-25 09:07:41 +03:00
13 changed files with 428 additions and 271 deletions

View File

@@ -205,6 +205,8 @@ CPedIK::PointGunInDirection(float targetYaw, float targetPitch)
else if (status == ANGLES_SET_EXACTLY)
m_flags |= GUN_POINTED_SUCCESSFULLY;
}
// Game uses index 2 directly, which happens to be identical to BONE_spine
#ifdef FIX_BUGS
RwMatrix *m = GetBoneMatrix(m_ped, BONE_spine);
#else
@@ -213,7 +215,7 @@ CPedIK::PointGunInDirection(float targetYaw, float targetPitch)
RwMatrix *m = &mats[2];
#endif
RwV3d axis = { 0.0f, 0.0f, 0.0f };
float axisangle = -CGeneral::LimitRadianAngle(Atan2(-m->up.y, -m->up.x) - m_ped->m_fRotationCur);
float axisangle = -CGeneral::LimitRadianAngle(Atan2(-m->at.y, -m->at.x) - m_ped->m_fRotationCur);
axis.y = -Sin(axisangle);
axis.z = Cos(axisangle);

View File

@@ -729,10 +729,17 @@ CPlayerPed::ProcessWeaponSwitch(CPad *padUsed)
for (m_nSelectedWepSlot = m_currentWeapon + 1; m_nSelectedWepSlot < TOTAL_WEAPON_SLOTS; ++m_nSelectedWepSlot) {
if (HasWeaponSlot(m_nSelectedWepSlot) && GetWeapon(m_nSelectedWepSlot).HasWeaponAmmoToBeUsed()) {
#ifdef FIX_BUGS
goto switchDetectDone;
#else
goto spentAmmoCheck;
#endif
}
}
m_nSelectedWepSlot = 0;
#ifdef FIX_BUGS
goto switchDetectDone;
#endif
}
} else if (padUsed->CycleWeaponLeftJustDown()) {
if (TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON
@@ -754,6 +761,10 @@ CPlayerPed::ProcessWeaponSwitch(CPad *padUsed)
--m_nSelectedWepSlot;
} while (m_nSelectedWepSlot != WEAPONSLOT_UNARMED);
#ifdef FIX_BUGS
goto switchDetectDone;
#endif
}
}
}