mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-26 04:05:40 +00:00
Ped: Real weapon fix
This commit is contained in:
parent
d3f2f4f6ac
commit
7b2f17826a
1 changed files with 21 additions and 29 deletions
|
@ -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) {
|
GetClump(), ourWeapon->m_AnimToPlay,
|
||||||
newReloadAssoc = CAnimManager::BlendAnimation(
|
bIsDucking && GetCrouchReloadAnim(ourWeapon) ? GetCrouchReloadAnim(ourWeapon) : GetReloadAnim(ourWeapon),
|
||||||
GetClump(), ourWeapon->m_AnimToPlay,
|
8.0f);
|
||||||
GetCrouchReloadAnim(ourWeapon),
|
|
||||||
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,23 +1021,23 @@ 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;
|
|
||||||
SetPointGunAt(m_pPointGunAt);
|
|
||||||
} else {
|
|
||||||
ClearAimFlag();
|
|
||||||
|
|
||||||
// Echoes of bullets, at the end of the attack. (Bug: doesn't play while reloading)
|
|
||||||
if (weaponAnimAssoc->currentTime - weaponAnimAssoc->timeStep < animLoopEnd)
|
|
||||||
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_AK47_BULLET_ECHO, ourWeaponType);
|
|
||||||
|
|
||||||
// Fun fact: removing this part leds to reloading flamethrower
|
|
||||||
if (ourWeaponType == WEAPONTYPE_FLAMETHROWER && weaponAnimAssoc->IsRunning()) {
|
|
||||||
weaponAnimAssoc->flags |= ASSOC_DELETEFADEDOUT;
|
|
||||||
weaponAnimAssoc->flags &= ~ASSOC_RUNNING;
|
weaponAnimAssoc->flags &= ~ASSOC_RUNNING;
|
||||||
weaponAnimAssoc->blendDelta = -4.0f;
|
SetPointGunAt(m_pPointGunAt);
|
||||||
|
} else {
|
||||||
|
ClearAimFlag();
|
||||||
|
|
||||||
|
// Echoes of bullets, at the end of the attack. (Bug: doesn't play while reloading)
|
||||||
|
if (weaponAnimAssoc->currentTime - weaponAnimAssoc->timeStep < animLoopEnd)
|
||||||
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_AK47_BULLET_ECHO, ourWeaponType);
|
||||||
|
|
||||||
|
// Fun fact: removing this part leds to reloading flamethrower
|
||||||
|
if (ourWeaponType == WEAPONTYPE_FLAMETHROWER && weaponAnimAssoc->IsRunning()) {
|
||||||
|
weaponAnimAssoc->flags |= ASSOC_DELETEFADEDOUT;
|
||||||
|
weaponAnimAssoc->flags &= ~ASSOC_RUNNING;
|
||||||
|
weaponAnimAssoc->blendDelta = -4.0f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue