1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-07-01 02:33:47 +00:00

Ped: Real weapon fix

This commit is contained in:
erorcun 2020-12-28 03:52:23 +03:00
parent d3f2f4f6ac
commit 7b2f17826a

View file

@ -972,20 +972,12 @@ CPed::Attack(void)
// Anim loop end, either start the loop again or finish the attack // Anim loop end, either start the loop again or finish the attack
if (weaponAnimTime > animLoopEnd || !weaponAnimAssoc->IsRunning() && ourWeaponFire != WEAPON_FIRE_PROJECTILE) { if (weaponAnimTime > animLoopEnd || !weaponAnimAssoc->IsRunning() && ourWeaponFire != WEAPON_FIRE_PROJECTILE) {
if (GetWeapon()->m_eWeaponState == WEAPONSTATE_RELOADING) { if (GetWeapon()->m_eWeaponState == WEAPONSTATE_RELOADING) {
if (ourWeapon->IsFlagSet(WEAPONFLAG_RELOAD) && !reloadAnimAssoc) { if (GetReloadAnim(ourWeapon) && !reloadAnimAssoc) {
if (!CWorld::Players[CWorld::PlayerInFocus].m_bFastReload) { if (!CWorld::Players[CWorld::PlayerInFocus].m_bFastReload) {
CAnimBlendAssociation *newReloadAssoc; CAnimBlendAssociation *newReloadAssoc = CAnimManager::BlendAnimation(
if (bIsDucking) {
newReloadAssoc = CAnimManager::BlendAnimation(
GetClump(), ourWeapon->m_AnimToPlay, GetClump(), ourWeapon->m_AnimToPlay,
GetCrouchReloadAnim(ourWeapon), bIsDucking && GetCrouchReloadAnim(ourWeapon) ? GetCrouchReloadAnim(ourWeapon) : GetReloadAnim(ourWeapon),
8.0f); 8.0f);
} else {
newReloadAssoc = CAnimManager::BlendAnimation(
GetClump(), ourWeapon->m_AnimToPlay,
GetReloadAnim(ourWeapon),
8.0f);
}
newReloadAssoc->SetFinishCallback(FinishedReloadCB, this); newReloadAssoc->SetFinishCallback(FinishedReloadCB, this);
} }
ClearLookFlag(); ClearLookFlag();
@ -1029,7 +1021,6 @@ CPed::Attack(void)
weaponAnimAssoc->SetCurrentTime(animLoopStart); weaponAnimAssoc->SetCurrentTime(animLoopStart);
weaponAnimAssoc->SetRun(); weaponAnimAssoc->SetRun();
} }
}
} else if (IsPlayer() && m_pPointGunAt && bIsAimingGun && GetWeapon()->m_eWeaponState != WEAPONSTATE_RELOADING) { } else if (IsPlayer() && m_pPointGunAt && bIsAimingGun && GetWeapon()->m_eWeaponState != WEAPONSTATE_RELOADING) {
weaponAnimAssoc->SetCurrentTime(animLoopEnd); weaponAnimAssoc->SetCurrentTime(animLoopEnd);
weaponAnimAssoc->flags &= ~ASSOC_RUNNING; weaponAnimAssoc->flags &= ~ASSOC_RUNNING;
@ -1048,6 +1039,7 @@ CPed::Attack(void)
weaponAnimAssoc->blendDelta = -4.0f; weaponAnimAssoc->blendDelta = -4.0f;
} }
} }
}
if (weaponAnimAssoc->currentTime > delayBetweenAnimAndFire) if (weaponAnimAssoc->currentTime > delayBetweenAnimAndFire)
attackShouldContinue = false; attackShouldContinue = false;