diff options
author | erorcun <erayorcunus@gmail.com> | 2020-05-15 20:30:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 20:30:57 +0200 |
commit | 8ff72f0728acbba293580042135f43268fa340fe (patch) | |
tree | 23cb65ca52efe5e964423ee50eff0e60ce8e155a /src/peds/Population.cpp | |
parent | CPedIK (diff) | |
parent | Weapon layer in Peds (diff) | |
download | re3-8ff72f0728acbba293580042135f43268fa340fe.tar re3-8ff72f0728acbba293580042135f43268fa340fe.tar.gz re3-8ff72f0728acbba293580042135f43268fa340fe.tar.bz2 re3-8ff72f0728acbba293580042135f43268fa340fe.tar.lz re3-8ff72f0728acbba293580042135f43268fa340fe.tar.xz re3-8ff72f0728acbba293580042135f43268fa340fe.tar.zst re3-8ff72f0728acbba293580042135f43268fa340fe.zip |
Diffstat (limited to 'src/peds/Population.cpp')
-rw-r--r-- | src/peds/Population.cpp | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp index 2dc0bbab..14bd042c 100644 --- a/src/peds/Population.cpp +++ b/src/peds/Population.cpp @@ -471,9 +471,28 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors, ped->SetOrientation(0.0f, 0.0f, 0.0f); CWorld::Add(ped); if (ms_bGivePedsWeapons) { - eWeaponType weapon = (eWeaponType)CGeneral::GetRandomNumberInRange(WEAPONTYPE_UNARMED, WEAPONTYPE_DETONATOR); + eWeaponType weapon; + + // TODO(Miami): Look here when weapons have been ported + switch (CGeneral::GetRandomNumber() & 3) { + case 0: + weapon = WEAPONTYPE_COLT45; + break; + case 1: + //weapon = WEAPONTYPE_NIGHTSTICK; + //break; + case 2: + //weapon = WEAPONTYPE_GOLFCLUB; + //break; + case 3: + weapon = WEAPONTYPE_TEC9; + break; + default: + break; + } if (weapon != WEAPONTYPE_UNARMED) { - ped->SetCurrentWeapon(ped->GiveWeapon(weapon, 25001)); + ped->GiveDelayedWeapon(weapon, 25001); + ped->SetCurrentWeapon(CWeaponInfo::GetWeaponInfo(weapon)->m_nWeaponSlot); } } return ped; @@ -501,12 +520,14 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors, ped->SetOrientation(0.0f, 0.0f, 0.0f); CWorld::Add(ped); - uint32 weapon; + eWeaponType weapon; if (CGeneral::GetRandomNumberInRange(0, 100) >= 50) - weapon = ped->GiveWeapon((eWeaponType)CGangs::GetGangInfo(pedType - PEDTYPE_GANG1)->m_Weapon2, 25001); + weapon = (eWeaponType)CGangs::GetGangInfo(pedType - PEDTYPE_GANG1)->m_Weapon2; else - weapon = ped->GiveWeapon((eWeaponType)CGangs::GetGangInfo(pedType - PEDTYPE_GANG1)->m_Weapon1, 25001); - ped->SetCurrentWeapon(weapon); + weapon = (eWeaponType)CGangs::GetGangInfo(pedType - PEDTYPE_GANG1)->m_Weapon1; + + ped->GiveDelayedWeapon(weapon, 25001); + ped->SetCurrentWeapon(CWeaponInfo::GetWeaponInfo(weapon)->m_nWeaponSlot); return ped; } case PEDTYPE_EMERGENCY: |