diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-03-22 11:09:18 +0100 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-03-22 11:09:18 +0100 |
commit | 65e85587941101f8ae346a363b1594b63983417b (patch) | |
tree | 2cb412d78396b2fea57dd39f06d1a3af9cacb8d1 /src/control/Gangs.cpp | |
parent | Merge remote-tracking branch 'upstream/master' (diff) | |
parent | Merge pull request #348 from erorcun/erorcun (diff) | |
download | re3-65e85587941101f8ae346a363b1594b63983417b.tar re3-65e85587941101f8ae346a363b1594b63983417b.tar.gz re3-65e85587941101f8ae346a363b1594b63983417b.tar.bz2 re3-65e85587941101f8ae346a363b1594b63983417b.tar.lz re3-65e85587941101f8ae346a363b1594b63983417b.tar.xz re3-65e85587941101f8ae346a363b1594b63983417b.tar.zst re3-65e85587941101f8ae346a363b1594b63983417b.zip |
Diffstat (limited to 'src/control/Gangs.cpp')
-rw-r--r-- | src/control/Gangs.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/control/Gangs.cpp b/src/control/Gangs.cpp index f5f609bc..f9cb4698 100644 --- a/src/control/Gangs.cpp +++ b/src/control/Gangs.cpp @@ -3,7 +3,8 @@ #include "ModelIndices.h" #include "Gangs.h" -CGangInfo(&CGangs::Gang)[NUM_GANGS] = *(CGangInfo(*)[NUM_GANGS])*(uintptr*)0x6EDF78; +//CGangInfo(&CGangs::Gang)[NUM_GANGS] = *(CGangInfo(*)[NUM_GANGS])*(uintptr*)0x6EDF78; +CGangInfo CGangs::Gang[NUM_GANGS]; CGangInfo::CGangInfo() : m_nVehicleMI(MI_BUS), @@ -34,11 +35,11 @@ void CGangs::SetGangVehicleModel(int16 gang, int32 model) GetGangInfo(gang)->m_nVehicleMI = model; } -void CGangs::SetGangWeapons(int16 gang, eWeaponType weapon1, eWeaponType weapon2) +void CGangs::SetGangWeapons(int16 gang, int32 weapon1, int32 weapon2) { CGangInfo *gi = GetGangInfo(gang); - gi->m_Weapon1 = weapon1; - gi->m_Weapon2 = weapon2; + gi->m_Weapon1 = (eWeaponType)weapon1; + gi->m_Weapon2 = (eWeaponType)weapon2; } void CGangs::SetGangPedModelOverride(int16 gang, int8 ovrd) @@ -68,11 +69,11 @@ void CGangs::LoadAllGangData(uint8 *buf, uint32 size) Initialize();
INITSAVEBUF
-
- WriteSaveHeader(buf, 'G','N','G','\0', size - SAVE_HEADER_SIZE); + // original: SkipSaveBuf(buf, SAVE_HEADER_SIZE);
+ CheckSaveHeader(buf, 'G','N','G','\0', size - SAVE_HEADER_SIZE); + for (int i = 0; i < NUM_GANGS; i++) Gang[i] = ReadSaveBuf<CGangInfo>(buf); - VALIDATESAVEBUF(size); } |