summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Ped.cpp4
-rw-r--r--src/peds/PedFight.cpp18
2 files changed, 15 insertions, 7 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 0c8e0416..acf219b4 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -4712,9 +4712,7 @@ CPed::GiveWeapon(eWeaponType weaponType, uint32 ammo, bool unused)
GetWeapon(slot).m_eWeaponState = WEAPONSTATE_READY;
} else {
if (HasWeaponSlot(slot)) {
-
- // TODO(Miami): Make an enum for that
- if (slot == 4 || slot == 5 || slot == 6)
+ if (CWeaponInfo::IsWeaponSlotAmmoMergeable(slot))
ammo += GetWeapon(slot).m_nAmmoTotal;
RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(GetWeapon(slot).m_eWeaponType)->m_nModelId);
diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp
index 43ef9b3d..4d4850e7 100644
--- a/src/peds/PedFight.cpp
+++ b/src/peds/PedFight.cpp
@@ -24,6 +24,7 @@
#include "World.h"
#include "Bike.h"
#include "Glass.h"
+#include "SpecialFX.h"
//--MIAMI: file done except TODOs
@@ -952,7 +953,18 @@ CPed::Attack(void)
}
}
- // TODO(Miami): CSpecialFX::AddWeaponStreak
+ if (IsPlayer()) {
+ eWeaponType weaponType = GetWeapon()->m_eWeaponType;
+ if (weaponType == WEAPONTYPE_BASEBALLBAT || weaponType == WEAPONTYPE_GOLFCLUB || weaponType == WEAPONTYPE_KATANA) {
+ float loopEndWithDelay = animLoopEnd;
+ if (loopEndWithDelay >= 98.0f)
+ loopEndWithDelay = (14.0f / 30.0f) + delayBetweenAnimAndFire;
+ if (weaponAnimAssoc->flags & ASSOC_RUNNING) {
+ if (weaponAnimAssoc->currentTime >= animLoopStart && weaponAnimAssoc->currentTime <= loopEndWithDelay)
+ CSpecialFX::AddWeaponStreak(weaponType);
+ }
+ }
+ }
// Anim breakout on running
if (IsPlayer()) {
@@ -1447,9 +1459,7 @@ CPed::Fight(void)
if (tFightMoves[m_curFightMove].startFireTime - streakDelay < currentAssoc->currentTime &&
streakDelay + tFightMoves[m_curFightMove].endFireTime > currentAssoc->currentTime) {
-
- // TODO(Miami): AddWeaponStreak
- // CSpecialFX::AddWeaponStreak(v2->m_weapons[(char)v2->m_currentWeapon].nWeaponId);
+ CSpecialFX::AddWeaponStreak(GetWeapon()->m_eWeaponType);
}
}
}