summaryrefslogtreecommitdiffstats
path: root/src/control/Gangs.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-03-17 19:03:13 +0100
committereray orçunus <erayorcunus@gmail.com>2020-03-21 12:58:54 +0100
commitd5a6e17079ab87b946132155bbe37bd20e27c239 (patch)
tree87a72ec36821bb04d9c08ed0e5730c2393b8fcf4 /src/control/Gangs.cpp
parentMerge pull request #346 from Sergeanur/Radar2 (diff)
downloadre3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar.gz
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar.bz2
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar.lz
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar.xz
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar.zst
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.zip
Diffstat (limited to 'src/control/Gangs.cpp')
-rw-r--r--src/control/Gangs.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/control/Gangs.cpp b/src/control/Gangs.cpp
index f6f9261e..6be1ef9c 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),
@@ -30,11 +31,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)
@@ -64,11 +65,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);
}