mirror of
https://github.com/halpz/re3.git
synced 2025-06-30 04:36:18 +00:00
ProcessButtonPresses and fixes
This commit is contained in:
@ -596,10 +596,10 @@ CCarCtrl::ChooseCarModel(int32 vehclass)
|
||||
case TAXI:
|
||||
{
|
||||
if (TotalNumOfCarsOfRating[vehclass] == 0)
|
||||
debug("ChooseCarModel : No cars of type %d have been declared\n");
|
||||
debug("ChooseCarModel : No cars of type %d have been declared\n", vehclass);
|
||||
model = CarArrays[vehclass][NextCarOfRating[vehclass]];
|
||||
int32 total = TotalNumOfCarsOfRating[vehclass];
|
||||
NextCarOfRating[vehclass] += 1 + CGeneral::GetRandomNumberInRange(0, total - 1);
|
||||
NextCarOfRating[vehclass] += CGeneral::GetRandomNumberInRange(1, total);
|
||||
while (NextCarOfRating[vehclass] >= total)
|
||||
NextCarOfRating[vehclass] -= total;
|
||||
//NextCarOfRating[vehclass] %= total;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -34,18 +34,16 @@ class CGangs
|
||||
public:
|
||||
static void Initialize(void);
|
||||
static void SetGangVehicleModel(int16, int32);
|
||||
static void SetGangWeapons(int16, eWeaponType, eWeaponType);
|
||||
static void SetGangWeapons(int16, int32, int32);
|
||||
static void SetGangPedModelOverride(int16, int8);
|
||||
static int8 GetGangPedModelOverride(int16);
|
||||
static void SaveAllGangData(uint8 *, uint32 *);
|
||||
static void LoadAllGangData(uint8 *, uint32);
|
||||
|
||||
static int32 GetGangVehicleModel(int16 gang) { return Gang[gang].m_nVehicleMI; }
|
||||
static eWeaponType GetGangWeapon1(int16 gang) { return Gang[gang].m_Weapon1; }
|
||||
static eWeaponType GetGangWeapon2(int16 gang) { return Gang[gang].m_Weapon2; }
|
||||
static CGangInfo* GetGangInfo(int16 gang) { return &Gang[gang]; }
|
||||
static CGangInfo *GetGangInfo(int16 gang) { return &Gang[gang]; }
|
||||
|
||||
private:
|
||||
|
||||
static CGangInfo(&Gang)[NUM_GANGS];
|
||||
static CGangInfo Gang[NUM_GANGS];
|
||||
};
|
||||
|
@ -14,7 +14,7 @@ int32 &CGarages::BankVansCollected = *(int32 *)0x8F1B34;
|
||||
bool &CGarages::BombsAreFree = *(bool *)0x95CD7A;
|
||||
bool &CGarages::RespraysAreFree = *(bool *)0x95CD1D;
|
||||
int32 &CGarages::CarsCollected = *(int32 *)0x880E18;
|
||||
int32 (&CGarages::CarTypesCollected)[TOTAL_COLLECTCARS_GARAGES] = *(int32 (*)[TOTAL_COLLECTCARS_GARAGES])(uintptr*)0x8E286C;
|
||||
int32 (&CGarages::CarTypesCollected)[TOTAL_COLLECTCARS_GARAGES] = *(int32 (*)[TOTAL_COLLECTCARS_GARAGES])*(uintptr*)0x8E286C;
|
||||
int32 &CGarages::CrushedCarId = *(int32 *)0x943060;
|
||||
uint32 &CGarages::LastTimeHelpMessage = *(uint32 *)0x8F1B58;
|
||||
int32 &CGarages::MessageNumberInString = *(int32 *)0x885BA8;
|
||||
@ -27,7 +27,7 @@ bool &CGarages::PlayerInGarage = *(bool *)0x95CD83;
|
||||
int32 &CGarages::PoliceCarsCollected = *(int32 *)0x941444;
|
||||
uint32 &CGarages::GarageToBeTidied = *(uint32 *)0x623570;
|
||||
|
||||
CGarage(&CGarages::Garages)[NUM_GARAGES] = *(CGarage(*)[NUM_GARAGES])(uintptr*)0x72BCD0;
|
||||
CGarage(&CGarages::Garages)[NUM_GARAGES] = *(CGarage(*)[NUM_GARAGES])*(uintptr*)0x72BCD0;
|
||||
|
||||
WRAPPER void CGarages::Init(void) { EAXJMP(0x421C60); }
|
||||
WRAPPER void CGarages::Update(void) { EAXJMP(0x421E40); }
|
||||
|
Reference in New Issue
Block a user