summaryrefslogtreecommitdiffstats
path: root/src/core/Pools.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-05-15 16:30:25 +0200
committereray orçunus <erayorcunus@gmail.com>2020-05-15 20:21:25 +0200
commitacd1ea9909da281acea6af8f0775e456a67d4a4a (patch)
tree414a38371f5157b403b03ed3c02e1680c99af166 /src/core/Pools.cpp
parentFix compilation (diff)
downloadre3-acd1ea9909da281acea6af8f0775e456a67d4a4a.tar
re3-acd1ea9909da281acea6af8f0775e456a67d4a4a.tar.gz
re3-acd1ea9909da281acea6af8f0775e456a67d4a4a.tar.bz2
re3-acd1ea9909da281acea6af8f0775e456a67d4a4a.tar.lz
re3-acd1ea9909da281acea6af8f0775e456a67d4a4a.tar.xz
re3-acd1ea9909da281acea6af8f0775e456a67d4a4a.tar.zst
re3-acd1ea9909da281acea6af8f0775e456a67d4a4a.zip
Diffstat (limited to 'src/core/Pools.cpp')
-rw-r--r--src/core/Pools.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp
index 17b9e08d..6838ef8e 100644
--- a/src/core/Pools.cpp
+++ b/src/core/Pools.cpp
@@ -499,8 +499,20 @@ INITSAVEBUF
pPed->CharCreatedBy = pBufferPlayer->CharCreatedBy;
pPed->m_currentWeapon = 0;
pPed->m_maxWeaponTypeAllowed = pBufferPlayer->m_maxWeaponTypeAllowed;
- for (int i = 0; i < WEAPONTYPE_TOTAL_INVENTORY_WEAPONS; i++)
- pPed->m_weapons[i] = pBufferPlayer->m_weapons[i];
+ for (int i = 0; i < TOTAL_WEAPON_SLOTS; i++) {
+ if (pBufferPlayer->HasWeaponSlot(i)) {
+ int modelId = CWeaponInfo::GetWeaponInfo(pBufferPlayer->GetWeapon(i).m_eWeaponType)->m_nModelId;
+ if (modelId != -1) {
+ CStreaming::RequestModel(modelId, STREAMFLAGS_DEPENDENCY);
+ int modelId2 = CWeaponInfo::GetWeaponInfo(pBufferPlayer->GetWeapon(i).m_eWeaponType)->m_nModel2Id;
+ if (modelId2 != -1)
+ CStreaming::RequestModel(modelId2, STREAMFLAGS_DEPENDENCY);
+
+ CStreaming::LoadAllRequestedModels(false);
+ }
+ pPed->GiveWeapon(pBufferPlayer->GetWeapon(i).m_eWeaponType, pBufferPlayer->GetWeapon(i).m_nAmmoTotal);
+ }
+ }
if (pedtype == PEDTYPE_PLAYER1) {
pPed->m_wepAccuracy = 100;