mirror of
https://github.com/halpz/re3.git
synced 2025-07-03 19:50:45 +00:00
Merge pull request #772 from Nick007J/miami
Original save/load support + bugfixes
This commit is contained in:
@ -20040,15 +20040,13 @@ CPed::Save(uint8*& buf)
|
||||
CopyToBuf(buf, GetPosition().z);
|
||||
SkipSaveBuf(buf, 288);
|
||||
CopyToBuf(buf, CharCreatedBy);
|
||||
SkipSaveBuf(buf, 351);
|
||||
SkipSaveBuf(buf, 499);
|
||||
CopyToBuf(buf, m_fHealth);
|
||||
CopyToBuf(buf, m_fArmour);
|
||||
SkipSaveBuf(buf, 148);
|
||||
for (int i = 0; i < 13; i++) // has to be hardcoded
|
||||
SkipSaveBuf(buf, 172);
|
||||
for (int i = 0; i < 10; i++) // has to be hardcoded
|
||||
m_weapons[i].Save(buf);
|
||||
SkipSaveBuf(buf, 5);
|
||||
CopyToBuf(buf, m_maxWeaponTypeAllowed);
|
||||
SkipSaveBuf(buf, 162);
|
||||
SkipSaveBuf(buf, 252);
|
||||
}
|
||||
|
||||
void
|
||||
@ -20060,16 +20058,15 @@ CPed::Load(uint8*& buf)
|
||||
CopyFromBuf(buf, GetMatrix().GetPosition().z);
|
||||
SkipSaveBuf(buf, 288);
|
||||
CopyFromBuf(buf, CharCreatedBy);
|
||||
SkipSaveBuf(buf, 351);
|
||||
SkipSaveBuf(buf, 499);
|
||||
CopyFromBuf(buf, m_fHealth);
|
||||
CopyFromBuf(buf, m_fArmour);
|
||||
SkipSaveBuf(buf, 148);
|
||||
SkipSaveBuf(buf, 172);
|
||||
m_currentWeapon = WEAPONTYPE_UNARMED;
|
||||
|
||||
CWeapon bufWeapon;
|
||||
for (int i = 0; i < 13; i++) { // has to be hardcoded
|
||||
for (int i = 0; i < 10; i++) { // has to be hardcoded
|
||||
bufWeapon.Load(buf);
|
||||
if (i >= 10)
|
||||
continue; // tmp hack before we fix save/load
|
||||
|
||||
if (bufWeapon.m_eWeaponType != WEAPONTYPE_UNARMED) {
|
||||
int modelId = CWeaponInfo::GetWeaponInfo(bufWeapon.m_eWeaponType)->m_nModelId;
|
||||
@ -20084,9 +20081,7 @@ CPed::Load(uint8*& buf)
|
||||
GiveWeapon(bufWeapon.m_eWeaponType, bufWeapon.m_nAmmoTotal);
|
||||
}
|
||||
}
|
||||
SkipSaveBuf(buf, 5);
|
||||
CopyFromBuf(buf, m_maxWeaponTypeAllowed);
|
||||
SkipSaveBuf(buf, 162);
|
||||
SkipSaveBuf(buf, 252);
|
||||
}
|
||||
#undef CopyFromBuf
|
||||
#undef CopyToBuf
|
||||
|
@ -135,8 +135,10 @@ void CPedAttractorManager::RemoveIceCreamVanEffects(C2dEffect* pEffect)
|
||||
if (vVehicleToEffect.empty())
|
||||
return;
|
||||
for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend();) {
|
||||
if (assoc->GetVehicle() != pVehicle)
|
||||
return;
|
||||
if (assoc->GetVehicle() != pVehicle) {
|
||||
assoc++;
|
||||
continue;
|
||||
}
|
||||
uint32 total = 0;
|
||||
for (uint32 j = 0; j < NUM_ATTRACTORS_FOR_ICECREAM_VAN; j++) {
|
||||
if (FindAssociatedAttractor(assoc->GetEffect(j), vIceCreamAttractors))
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
const uint32 CPlayerPed::nSaveStructSize =
|
||||
#ifdef COMPATIBLE_SAVES
|
||||
1520;
|
||||
1752;
|
||||
#else
|
||||
sizeof(CPlayerPed);
|
||||
#endif
|
||||
@ -1935,7 +1935,7 @@ CPlayerPed::Save(uint8*& buf)
|
||||
CopyToBuf(buf, m_nTargettableObjects[1]);
|
||||
CopyToBuf(buf, m_nTargettableObjects[2]);
|
||||
CopyToBuf(buf, m_nTargettableObjects[3]);
|
||||
SkipSaveBuf(buf, 116);
|
||||
SkipSaveBuf(buf, 164);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1949,7 +1949,7 @@ CPlayerPed::Load(uint8*& buf)
|
||||
CopyFromBuf(buf, m_nTargettableObjects[1]);
|
||||
CopyFromBuf(buf, m_nTargettableObjects[2]);
|
||||
CopyFromBuf(buf, m_nTargettableObjects[3]);
|
||||
SkipSaveBuf(buf, 116);
|
||||
SkipSaveBuf(buf, 164);
|
||||
}
|
||||
#undef CopyFromBuf
|
||||
#undef CopyToBuf
|
||||
|
Reference in New Issue
Block a user