script and script stubs #557

Merged
Nick007J merged 9 commits from miami into miami 5 years ago

@ -104,7 +104,7 @@ strcmpIgnoringDigits(const char *s1, const char *s2)
c2 = toupper(c2); c2 = toupper(c2);
#endif #endif
if(c1 != c2) if(c1 && c2 && c1 != c2)
return false; return false;
} }
} }

@ -358,7 +358,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->AutoPilot.m_nCruiseSpeed = FindPoliceCarSpeedForWantedLevel(pVehicle); pVehicle->AutoPilot.m_nCruiseSpeed = FindPoliceCarSpeedForWantedLevel(pVehicle);
pVehicle->SetStatus(STATUS_PHYSICS); pVehicle->SetStatus(STATUS_PHYSICS);
pVehicle->AutoPilot.m_nCarMission = pVehicle->AutoPilot.m_nCarMission =
pVehicle->GetVehicleAppearance() == VEHICLE_BOAT ? FindPoliceBoatMissionForWantedLevel() : FindPoliceCarMissionForWantedLevel(); pVehicle->GetVehicleAppearance() == VEHICLE_APPEARANCE_BOAT ? FindPoliceBoatMissionForWantedLevel() : FindPoliceCarMissionForWantedLevel();
pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE; pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE;
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS; pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS;
}else if (pVehicle->AutoPilot.m_nCarMission == MISSION_CRUISE){ }else if (pVehicle->AutoPilot.m_nCarMission == MISSION_CRUISE){
@ -432,7 +432,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
if (pVehicle->bIsLawEnforcer) { if (pVehicle->bIsLawEnforcer) {
if (pVehicle->AutoPilot.m_nCarMission == MISSION_RAMPLAYER_FARAWAY || if (pVehicle->AutoPilot.m_nCarMission == MISSION_RAMPLAYER_FARAWAY ||
pVehicle->AutoPilot.m_nCarMission == MISSION_RAMPLAYER_CLOSE) { pVehicle->AutoPilot.m_nCarMission == MISSION_RAMPLAYER_CLOSE) {
if (FindPlayerVehicle() && FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_BIKE) if (FindPlayerVehicle() && FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_APPEARANCE_BIKE)
pVehicle->AutoPilot.m_nCarMission = MISSION_BLOCKPLAYER_FARAWAY; pVehicle->AutoPilot.m_nCarMission = MISSION_BLOCKPLAYER_FARAWAY;
} }
} }
@ -489,16 +489,16 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
if (pVehicle->bIsLawEnforcer && FindPlayerPed()->m_pWanted->m_nWantedLevel > 0) { if (pVehicle->bIsLawEnforcer && FindPlayerPed()->m_pWanted->m_nWantedLevel > 0) {
if (!FindPlayerVehicle() || if (!FindPlayerVehicle() ||
FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_CAR || FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_APPEARANCE_CAR ||
FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_BIKE) { FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_APPEARANCE_BIKE) {
if (pVehicle->GetVehicleAppearance() == VEHICLE_BOAT) { if (pVehicle->GetVehicleAppearance() == VEHICLE_APPEARANCE_BOAT) {
pVehicle->AutoPilot.m_nTempAction = TEMPACT_WAIT; pVehicle->AutoPilot.m_nTempAction = TEMPACT_WAIT;
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 1000; pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 1000;
} }
} }
else if (FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_BOAT) { else if (FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_APPEARANCE_BOAT) {
if (pVehicle->GetVehicleAppearance() == VEHICLE_CAR || if (pVehicle->GetVehicleAppearance() == VEHICLE_APPEARANCE_CAR ||
pVehicle->GetVehicleAppearance() == VEHICLE_BIKE) { pVehicle->GetVehicleAppearance() == VEHICLE_APPEARANCE_BIKE) {
pVehicle->AutoPilot.m_nTempAction = TEMPACT_WAIT; pVehicle->AutoPilot.m_nTempAction = TEMPACT_WAIT;
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 1000; pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 1000;
} }

@ -655,10 +655,10 @@ CCarCtrl::GenerateOneRandomCar()
} }
int nMadDrivers; int nMadDrivers;
switch (pVehicle->GetVehicleAppearance()) { switch (pVehicle->GetVehicleAppearance()) {
case VEHICLE_BIKE: case VEHICLE_APPEARANCE_BIKE:
nMadDrivers = 30; nMadDrivers = 30;
break; break;
case VEHICLE_BOAT: case VEHICLE_APPEARANCE_BOAT:
nMadDrivers = 40; nMadDrivers = 40;
break; break;
default: default:

@ -960,7 +960,7 @@ void CGarage::Update()
if (m_pDoor1) { if (m_pDoor1) {
if (((CVector2D)FindPlayerVehicle()->GetPosition() - (CVector2D)m_pDoor1->GetPosition()).MagnitudeSqr() < SQR(DISTANCE_TO_SHOW_HIDEOUT_MESSAGE) && if (((CVector2D)FindPlayerVehicle()->GetPosition() - (CVector2D)m_pDoor1->GetPosition()).MagnitudeSqr() < SQR(DISTANCE_TO_SHOW_HIDEOUT_MESSAGE) &&
CTimer::GetTimeInMilliseconds() - CGarages::LastTimeHelpMessage > TIME_BETWEEN_HIDEOUT_MESSAGES) { CTimer::GetTimeInMilliseconds() - CGarages::LastTimeHelpMessage > TIME_BETWEEN_HIDEOUT_MESSAGES) {
if (FindPlayerVehicle()->GetVehicleAppearance() != VEHICLE_HELI && FindPlayerVehicle()->GetVehicleAppearance() != VEHICLE_PLANE) { if (FindPlayerVehicle()->GetVehicleAppearance() != VEHICLE_APPEARANCE_HELI && FindPlayerVehicle()->GetVehicleAppearance() != VEHICLE_APPEARANCE_PLANE) {
CHud::SetHelpMessage(TheText.Get("GA_21"), false); // You cannot store any more cars in this garage. CHud::SetHelpMessage(TheText.Get("GA_21"), false); // You cannot store any more cars in this garage.
CGarages::LastTimeHelpMessage = CTimer::GetTimeInMilliseconds(); CGarages::LastTimeHelpMessage = CTimer::GetTimeInMilliseconds();
} }

@ -158,12 +158,12 @@ CPickup::GiveUsAPickUpObject(int32 handle)
} }
bool bool
CPickup::CanBePickedUp(CPlayerPed *player) CPickup::CanBePickedUp(CPlayerPed *player, int playerId)
{ {
assert(m_pObject != nil); assert(m_pObject != nil);
bool cannotBePickedUp = bool cannotBePickedUp =
(m_pObject->GetModelIndex() == MI_PICKUP_BODYARMOUR && player->m_fArmour > 99.5f) (m_pObject->GetModelIndex() == MI_PICKUP_BODYARMOUR && player->m_fArmour > CWorld::Players[playerId].m_nMaxArmour - 0.5f)
|| (m_pObject->GetModelIndex() == MI_PICKUP_HEALTH && player->m_fHealth > 99.5f) || (m_pObject->GetModelIndex() == MI_PICKUP_HEALTH && player->m_fHealth > CWorld::Players[playerId].m_nMaxHealth - 0.5f)
|| (m_pObject->GetModelIndex() == MI_PICKUP_BRIBE && player->m_pWanted->m_nWantedLevel == 0) || (m_pObject->GetModelIndex() == MI_PICKUP_BRIBE && player->m_pWanted->m_nWantedLevel == 0)
|| (m_pObject->GetModelIndex() == MI_PICKUP_KILLFRENZY && (CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame)); || (m_pObject->GetModelIndex() == MI_PICKUP_KILLFRENZY && (CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame));
return !cannotBePickedUp; return !cannotBePickedUp;
@ -219,7 +219,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
} }
// if we didn't then we've got nothing to do // if we didn't then we've got nothing to do
if (isPickupTouched && CanBePickedUp(player)) { if (isPickupTouched && CanBePickedUp(player, playerId)) {
CPad::GetPad(0)->StartShake(120, 100); CPad::GetPad(0)->StartShake(120, 100);
switch (m_eType) switch (m_eType)
{ {
@ -483,14 +483,14 @@ CPickups::GivePlayerGoodiesWithPickUpMI(int16 modelIndex, int playerIndex)
DMAudio.PlayFrontEndSound(SOUND_PICKUP_ADRENALINE, 0); DMAudio.PlayFrontEndSound(SOUND_PICKUP_ADRENALINE, 0);
return true; return true;
} else if (modelIndex == MI_PICKUP_BODYARMOUR) { } else if (modelIndex == MI_PICKUP_BODYARMOUR) {
player->m_fArmour = 100.0f; player->m_fArmour = CWorld::Players[playerIndex].m_nMaxArmour;
DMAudio.PlayFrontEndSound(SOUND_PICKUP_ARMOUR, 0); DMAudio.PlayFrontEndSound(SOUND_PICKUP_ARMOUR, 0);
return true; return true;
} else if (modelIndex == MI_PICKUP_INFO) { } else if (modelIndex == MI_PICKUP_INFO) {
DMAudio.PlayFrontEndSound(SOUND_PICKUP_BONUS, 0); DMAudio.PlayFrontEndSound(SOUND_PICKUP_BONUS, 0);
return true; return true;
} else if (modelIndex == MI_PICKUP_HEALTH) { } else if (modelIndex == MI_PICKUP_HEALTH) {
player->m_fHealth = 100.0f; player->m_fHealth = CWorld::Players[playerIndex].m_nMaxHealth;
DMAudio.PlayFrontEndSound(SOUND_PICKUP_HEALTH, 0); DMAudio.PlayFrontEndSound(SOUND_PICKUP_HEALTH, 0);
return true; return true;
} else if (modelIndex == MI_PICKUP_BONUS) { } else if (modelIndex == MI_PICKUP_BONUS) {

@ -46,7 +46,7 @@ public:
bool Update(CPlayerPed *player, CVehicle *vehicle, int playerId); bool Update(CPlayerPed *player, CVehicle *vehicle, int playerId);
private: private:
bool IsMine() { return m_eType >= PICKUP_MINE_INACTIVE && m_eType <= PICKUP_FLOATINGPACKAGE_FLOATING; } bool IsMine() { return m_eType >= PICKUP_MINE_INACTIVE && m_eType <= PICKUP_FLOATINGPACKAGE_FLOATING; }
inline bool CanBePickedUp(CPlayerPed *player); inline bool CanBePickedUp(CPlayerPed *player, int playerId);
void RemoveKeepType(); void RemoveKeepType();
void Remove(); void Remove();
}; };

File diff suppressed because it is too large Load Diff

@ -221,8 +221,8 @@ enum {
}; };
enum { enum {
SIZE_MAIN_SCRIPT = 128 * 1024, SIZE_MAIN_SCRIPT = 225512,
SIZE_MISSION_SCRIPT = 32 * 1024, SIZE_MISSION_SCRIPT = 35000,
SIZE_SCRIPT_SPACE = SIZE_MAIN_SCRIPT + SIZE_MISSION_SCRIPT SIZE_SCRIPT_SPACE = SIZE_MAIN_SCRIPT + SIZE_MISSION_SCRIPT
}; };
@ -507,4 +507,6 @@ private:
return false; return false;
} }
} }
static bool ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami);
}; };

@ -61,6 +61,8 @@ enum
CCamera TheCamera; CCamera TheCamera;
bool CCamera::m_bUseMouse3rdPerson = true; bool CCamera::m_bUseMouse3rdPerson = true;
bool bDidWeProcessAnyCinemaCam; bool bDidWeProcessAnyCinemaCam;
float CCamera::m_f3rdPersonCHairMultX;
float CCamera::m_f3rdPersonCHairMultY;
#ifdef IMPROVED_CAMERA #ifdef IMPROVED_CAMERA
#define KEYJUSTDOWN(k) ControlsManager.GetIsKeyboardKeyJustDown((RsKeyCodes)k) #define KEYJUSTDOWN(k) ControlsManager.GetIsKeyboardKeyJustDown((RsKeyCodes)k)

@ -472,8 +472,8 @@ public:
// not static yet // not static yet
float m_fMouseAccelHorzntl;// acceleration multiplier for 1st person controls float m_fMouseAccelHorzntl;// acceleration multiplier for 1st person controls
float m_fMouseAccelVertical;// acceleration multiplier for 1st person controls float m_fMouseAccelVertical;// acceleration multiplier for 1st person controls
float m_f3rdPersonCHairMultX; static float m_f3rdPersonCHairMultX;
float m_f3rdPersonCHairMultY; static float m_f3rdPersonCHairMultY;
CCam Cams[3]; CCam Cams[3];

@ -100,7 +100,7 @@ void WeaponCheat()
void HealthCheat() void HealthCheat()
{ {
CHud::SetHelpMessage(TheText.Get("CHEAT3"), true); CHud::SetHelpMessage(TheText.Get("CHEAT3"), true);
FindPlayerPed()->m_fHealth = 100.0f; FindPlayerPed()->m_fHealth = CWorld::Players[0].m_nMaxHealth;
if (FindPlayerVehicle()) { if (FindPlayerVehicle()) {
FindPlayerVehicle()->m_fHealth = 1000.0f; FindPlayerVehicle()->m_fHealth = 1000.0f;
if (FindPlayerVehicle()->m_vehType == VEHICLE_TYPE_CAR) if (FindPlayerVehicle()->m_vehType == VEHICLE_TYPE_CAR)
@ -224,7 +224,7 @@ void MoneyCheat()
void ArmourCheat() void ArmourCheat()
{ {
CHud::SetHelpMessage(TheText.Get("CHEAT4"), true); CHud::SetHelpMessage(TheText.Get("CHEAT4"), true);
FindPlayerPed()->m_fArmour = 100.0f; FindPlayerPed()->m_fArmour = CWorld::Players[0].m_nMaxArmour;
} }
void WantedLevelUpCheat() void WantedLevelUpCheat()

@ -140,6 +140,7 @@ CPlayerInfo::Clear(void)
m_nUpsideDownCounter = 0; m_nUpsideDownCounter = 0;
m_bInfiniteSprint = false; m_bInfiniteSprint = false;
m_bFastReload = false; m_bFastReload = false;
m_nMaxHealth = m_nMaxArmour = 100;
m_bGetOutOfJailFree = false; m_bGetOutOfJailFree = false;
m_bGetOutOfHospitalFree = false; m_bGetOutOfHospitalFree = false;
m_bDriveByAllowed = true; m_bDriveByAllowed = true;

@ -52,6 +52,9 @@ public:
int32 field_272; int32 field_272;
bool m_bInfiniteSprint; bool m_bInfiniteSprint;
bool m_bFastReload; bool m_bFastReload;
bool m_bFireproof;
uint8 m_nMaxHealth;
uint8 m_nMaxArmour;
bool m_bGetOutOfJailFree; bool m_bGetOutOfJailFree;
bool m_bGetOutOfHospitalFree; bool m_bGetOutOfHospitalFree;
bool m_bDriveByAllowed; bool m_bDriveByAllowed;

@ -61,6 +61,7 @@ int32 CStats::HighestScores[CStats::TOTAL_HIGHEST_SCORES];
int32 CStats::Sprayings; int32 CStats::Sprayings;
float CStats::AutoPaintingBudget; float CStats::AutoPaintingBudget;
int32 CStats::NoMoreHurricanes; int32 CStats::NoMoreHurricanes;
float CStats::FashionBudget;
void CStats::Init() void CStats::Init()
{ {
@ -257,6 +258,11 @@ float CStats::GetPercentageProgress()
return Min(percentCompleted, 100.0f); return Min(percentCompleted, 100.0f);
} }
void CStats::MoneySpentOnFashion(int32 money)
{
FashionBudget += money;
}
void CStats::SaveStats(uint8 *buf, uint32 *size) void CStats::SaveStats(uint8 *buf, uint32 *size)
{ {
CheckPointReachedSuccessfully(); CheckPointReachedSuccessfully();

@ -65,6 +65,7 @@ public:
static int32 Sprayings; static int32 Sprayings;
static float AutoPaintingBudget; static float AutoPaintingBudget;
static int32 NoMoreHurricanes; static int32 NoMoreHurricanes;
static float FashionBudget;
public: public:
static void Init(void); static void Init(void);
@ -91,4 +92,6 @@ public:
static void SaveStats(uint8 *buf, uint32 *size); static void SaveStats(uint8 *buf, uint32 *size);
static void LoadStats(uint8 *buf, uint32 size); static void LoadStats(uint8 *buf, uint32 size);
static float GetPercentageProgress(); static float GetPercentageProgress();
static void MoneySpentOnFashion(int32);
}; };

@ -160,7 +160,9 @@
X("subplatform_sub", MI_SUBPLATFORM_SUB2, 0x5F5BC0) \ X("subplatform_sub", MI_SUBPLATFORM_SUB2, 0x5F5BC0) \
X("files", MI_FILES, 0x5F5BC4) \ X("files", MI_FILES, 0x5F5BC4) \
X("property_locked", MI_PICKUP_PROPERTY, 0x0) \ X("property_locked", MI_PICKUP_PROPERTY, 0x0) \
X("property_fsale", MI_PICKUP_PROPERTY_FORSALE, 0x0) X("property_fsale", MI_PICKUP_PROPERTY_FORSALE, 0x0) \
X("clothesp", MI_PICKUP_CLOTHES, 0x0) \
X("bigdollar", MI_PICKUP_REVENUE, 0x0)
#define X(name, var, addr) extern int16 var; #define X(name, var, addr) extern int16 var;
MODELINDICES MODELINDICES

@ -325,7 +325,7 @@ CCivilianPed::ProcessControl(void)
CWorld::Players[CWorld::PlayerInFocus].m_nSexFrequency = Max(250, playerSexFrequency - 10); CWorld::Players[CWorld::PlayerInFocus].m_nSexFrequency = Max(250, playerSexFrequency - 10);
} }
m_pMyVehicle->pDriver->m_fHealth = Min(125.0f, 1.0f + m_pMyVehicle->pDriver->m_fHealth); m_pMyVehicle->pDriver->m_fHealth = Min(CWorld::Players[0].m_nMaxHealth + 25.0f, 1.0f + m_pMyVehicle->pDriver->m_fHealth);
if (CWorld::Players[CWorld::PlayerInFocus].m_nSexFrequency == 250) if (CWorld::Players[CWorld::PlayerInFocus].m_nSexFrequency == 250)
CWorld::Players[CWorld::PlayerInFocus].m_nNextSexFrequencyUpdateTime = CTimer::GetTimeInMilliseconds() + 3000; CWorld::Players[CWorld::PlayerInFocus].m_nNextSexFrequencyUpdateTime = CTimer::GetTimeInMilliseconds() + 3000;
} else { } else {
@ -336,7 +336,7 @@ CCivilianPed::ProcessControl(void)
} else { } else {
bWanderPathAfterExitingCar = true; bWanderPathAfterExitingCar = true;
CWorld::Players[CWorld::PlayerInFocus].m_pHooker = nil; CWorld::Players[CWorld::PlayerInFocus].m_pHooker = nil;
m_pMyVehicle->pDriver->m_fHealth = 125.0f; m_pMyVehicle->pDriver->m_fHealth = CWorld::Players[0].m_nMaxHealth + 25.0f;
SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
} }
} else { } else {

@ -537,6 +537,8 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
m_fAirResistance = 0.4f / m_fMass; m_fAirResistance = 0.4f / m_fMass;
m_fElasticity = 0.05f; m_fElasticity = 0.05f;
m_ceaseAttackTimer = 0;
bIsStanding = false; bIsStanding = false;
bWasStanding = false; bWasStanding = false;
bIsAttacking = false; bIsAttacking = false;

@ -209,7 +209,7 @@ enum eObjective : uint32 {
OBJECTIVE_LEAVE_CAR_AND_DIE, OBJECTIVE_LEAVE_CAR_AND_DIE,
OBJECTIVE_USE_SEAT_ATTRACTOR, OBJECTIVE_USE_SEAT_ATTRACTOR,
OBJECTIVE_USE_ATM_ATTRACTOR, OBJECTIVE_USE_ATM_ATTRACTOR,
OBJECTIVE_FLEE_CAR, // is it 41? OBJECTIVE_FLEE_CAR,
OBJ_42, OBJ_42,
OBJECTIVE_USE_STOP_ATTRACTOR, OBJECTIVE_USE_STOP_ATTRACTOR,
OBJECTIVE_USE_PIZZA_ATTRACTOR, OBJECTIVE_USE_PIZZA_ATTRACTOR,
@ -551,7 +551,7 @@ public:
uint32 m_duckAndCoverTimer; uint32 m_duckAndCoverTimer;
uint32 m_bloodyFootprintCountOrDeathTime; // Death time when bDoBloodyFootprints is false. Weird decision uint32 m_bloodyFootprintCountOrDeathTime; // Death time when bDoBloodyFootprints is false. Weird decision
uint32 m_shotTime; uint32 m_shotTime;
uint32 m_shotTimeAdd; uint32 m_ceaseAttackTimer;
uint8 m_panicCounter; uint8 m_panicCounter;
bool m_deadBleeding; bool m_deadBleeding;
int8 m_bodyPartBleeding; // PedNode, but -1 if there isn't int8 m_bodyPartBleeding; // PedNode, but -1 if there isn't

@ -72,6 +72,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
bFixedColour = false; bFixedColour = false;
bBigWheels = false; bBigWheels = false;
bWaterTight = false; bWaterTight = false;
bTankDetonateCars = true;
SetModelIndex(id); SetModelIndex(id);
@ -332,7 +333,7 @@ CAutomobile::ProcessControl(void)
bool playerRemote = false; bool playerRemote = false;
switch(GetStatus()){ switch(GetStatus()){
case STATUS_PLAYER_REMOTE: case STATUS_PLAYER_REMOTE:
if(CPad::GetPad(0)->WeaponJustDown()){ if(CPad::GetPad(0)->WeaponJustDown() && !bDisableRemoteDetonation){
BlowUpCar(FindPlayerPed()); BlowUpCar(FindPlayerPed());
CRemote::TakeRemoteControlledCarFromPlayer(); CRemote::TakeRemoteControlledCarFromPlayer();
} }
@ -4148,7 +4149,7 @@ CAutomobile::BlowUpCarsInPath(void)
{ {
int i; int i;
if(m_vecMoveSpeed.Magnitude() > 0.1f) if(m_vecMoveSpeed.Magnitude() > 0.1f && bTankDetonateCars)
for(i = 0; i < m_nCollisionRecords; i++) for(i = 0; i < m_nCollisionRecords; i++)
if(m_aCollisionRecords[i] && if(m_aCollisionRecords[i] &&
m_aCollisionRecords[i]->IsVehicle() && m_aCollisionRecords[i]->IsVehicle() &&
@ -4610,6 +4611,18 @@ CAutomobile::SetAllTaxiLights(bool set)
m_sAllTaxiLights = set; m_sAllTaxiLights = set;
} }
void
CAutomobile::TellHeliToGoToCoors(float x, float y, float z, uint8 speed)
{
AutoPilot.m_nCarMission = MISSION_HELI_FLYTOCOORS;
AutoPilot.m_vecDestinationCoors.x = x;
AutoPilot.m_vecDestinationCoors.y = y;
AutoPilot.m_vecDestinationCoors.z = z;
AutoPilot.m_nCruiseSpeed = speed;
SetStatus(STATUS_PHYSICS);
//TODO(MIAMI)
}
#ifdef COMPATIBLE_SAVES #ifdef COMPATIBLE_SAVES
void void
CAutomobile::Save(uint8*& buf) CAutomobile::Save(uint8*& buf)

@ -91,6 +91,7 @@ public:
uint8 bWaterTight : 1; // no damage for non-player peds uint8 bWaterTight : 1; // no damage for non-player peds
uint8 bNotDamagedUpsideDown : 1; uint8 bNotDamagedUpsideDown : 1;
uint8 bMoreResistantToDamage : 1; uint8 bMoreResistantToDamage : 1;
uint8 bTankDetonateCars : 1;
int16 field_4E0; int16 field_4E0;
uint16 m_hydraulicState; uint16 m_hydraulicState;
uint32 m_nBusDoorTimerEnd; uint32 m_nBusDoorTimerEnd;
@ -178,6 +179,8 @@ public:
void SetBumperDamage(int32 component, ePanels panel, bool noFlyingComponents = false); void SetBumperDamage(int32 component, ePanels panel, bool noFlyingComponents = false);
void SetDoorDamage(int32 component, eDoors door, bool noFlyingComponents = false); void SetDoorDamage(int32 component, eDoors door, bool noFlyingComponents = false);
void TellHeliToGoToCoors(float x, float y, float z, uint8 speed);
void Fix(void); void Fix(void);
void SetComponentVisibility(RwFrame *frame, uint32 flags); void SetComponentVisibility(RwFrame *frame, uint32 flags);
void SetupModelNodes(void); void SetupModelNodes(void);

@ -29,6 +29,7 @@ bool CVehicle::bCheat5;
bool CVehicle::bAltDodoCheat; bool CVehicle::bAltDodoCheat;
#endif #endif
bool CVehicle::m_bDisableMouseSteering = true; bool CVehicle::m_bDisableMouseSteering = true;
bool CVehicle::bDisableRemoteDetonation;
void *CVehicle::operator new(size_t sz) { return CPools::GetVehiclePool()->New(); } void *CVehicle::operator new(size_t sz) { return CPools::GetVehiclePool()->New(); }
void *CVehicle::operator new(size_t sz, int handle) { return CPools::GetVehiclePool()->New(handle); } void *CVehicle::operator new(size_t sz, int handle) { return CPools::GetVehiclePool()->New(handle); }
@ -1080,14 +1081,14 @@ CVehicle::SetDriver(CPed *driver)
if(bFreebies && driver == FindPlayerPed()){ if(bFreebies && driver == FindPlayerPed()){
if(GetModelIndex() == MI_AMBULAN) if(GetModelIndex() == MI_AMBULAN)
FindPlayerPed()->m_fHealth = Min(FindPlayerPed()->m_fHealth + 20.0f, 100.0f); FindPlayerPed()->m_fHealth = Min(FindPlayerPed()->m_fHealth + 20.0f, CWorld::Players[0].m_nMaxHealth);
else if(GetModelIndex() == MI_TAXI) else if(GetModelIndex() == MI_TAXI)
CWorld::Players[CWorld::PlayerInFocus].m_nMoney += 25; CWorld::Players[CWorld::PlayerInFocus].m_nMoney += 25;
else if (GetModelIndex() == MI_POLICE) { else if (GetModelIndex() == MI_POLICE) {
CStreaming::RequestModel(WEAPONTYPE_SHOTGUN, STREAMFLAGS_DONT_REMOVE); CStreaming::RequestModel(WEAPONTYPE_SHOTGUN, STREAMFLAGS_DONT_REMOVE);
driver->GiveWeapon(WEAPONTYPE_SHOTGUN, 5); driver->GiveWeapon(WEAPONTYPE_SHOTGUN, 5);
} else if (GetModelIndex() == MI_ENFORCER) } else if (GetModelIndex() == MI_ENFORCER)
driver->m_fArmour = Max(driver->m_fArmour, 100.0f); driver->m_fArmour = Max(driver->m_fArmour, CWorld::Players[0].m_nMaxArmour);
else if(GetModelIndex() == MI_CABBIE || GetModelIndex() == MI_ZEBRA) // TODO(MIAMI): check zebra else if(GetModelIndex() == MI_CABBIE || GetModelIndex() == MI_ZEBRA) // TODO(MIAMI): check zebra
CWorld::Players[CWorld::PlayerInFocus].m_nMoney += 25; CWorld::Players[CWorld::PlayerInFocus].m_nMoney += 25;
bFreebies = false; bFreebies = false;
@ -1353,14 +1354,14 @@ eVehicleAppearance
CVehicle::GetVehicleAppearance(void) CVehicle::GetVehicleAppearance(void)
{ {
if (IsCar()) if (IsCar())
return VEHICLE_CAR; return VEHICLE_APPEARANCE_CAR;
if (IsBoat()) if (IsBoat())
return VEHICLE_BOAT; return VEHICLE_APPEARANCE_BOAT;
if (IsBike()) if (IsBike())
return VEHICLE_BIKE; return VEHICLE_APPEARANCE_BIKE;
if (IsPlane()) if (IsPlane())
return VEHICLE_PLANE; return VEHICLE_APPEARANCE_PLANE;
if (IsHeli()) if (IsHeli())
return VEHICLE_HELI; return VEHICLE_APPEARANCE_HELI;
return VEHICLE_NONE; return VEHICLE_APPEARANCE_NONE;
} }

@ -112,12 +112,12 @@ enum eFlightModel
enum eVehicleAppearance enum eVehicleAppearance
{ {
VEHICLE_NONE, VEHICLE_APPEARANCE_NONE,
VEHICLE_CAR, VEHICLE_APPEARANCE_CAR,
VEHICLE_BIKE, VEHICLE_APPEARANCE_BIKE,
VEHICLE_HELI, VEHICLE_APPEARANCE_HELI,
VEHICLE_BOAT, VEHICLE_APPEARANCE_BOAT,
VEHICLE_PLANE, VEHICLE_APPEARANCE_PLANE,
}; };
// Or Weapon.h? // Or Weapon.h?
@ -310,6 +310,7 @@ public:
static bool bAltDodoCheat; static bool bAltDodoCheat;
#endif #endif
static bool m_bDisableMouseSteering; static bool m_bDisableMouseSteering;
static bool bDisableRemoteDetonation;
}; };
void DestroyVehicleAndDriverAndPassengers(CVehicle* pVehicle); void DestroyVehicleAndDriverAndPassengers(CVehicle* pVehicle);