mirror of
https://github.com/halpz/re3.git
synced 2025-06-28 15:26:19 +00:00
Merge branch 'miami' of https://github.com/GTAmodding/re3 into miami
This commit is contained in:
@ -358,7 +358,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||
pVehicle->AutoPilot.m_nCruiseSpeed = FindPoliceCarSpeedForWantedLevel(pVehicle);
|
||||
pVehicle->SetStatus(STATUS_PHYSICS);
|
||||
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_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS;
|
||||
}else if (pVehicle->AutoPilot.m_nCarMission == MISSION_CRUISE){
|
||||
@ -432,7 +432,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||
if (pVehicle->bIsLawEnforcer) {
|
||||
if (pVehicle->AutoPilot.m_nCarMission == MISSION_RAMPLAYER_FARAWAY ||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -489,16 +489,16 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||
|
||||
if (pVehicle->bIsLawEnforcer && FindPlayerPed()->m_pWanted->m_nWantedLevel > 0) {
|
||||
if (!FindPlayerVehicle() ||
|
||||
FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_CAR ||
|
||||
FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_BIKE) {
|
||||
if (pVehicle->GetVehicleAppearance() == VEHICLE_BOAT) {
|
||||
FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_APPEARANCE_CAR ||
|
||||
FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_APPEARANCE_BIKE) {
|
||||
if (pVehicle->GetVehicleAppearance() == VEHICLE_APPEARANCE_BOAT) {
|
||||
pVehicle->AutoPilot.m_nTempAction = TEMPACT_WAIT;
|
||||
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 1000;
|
||||
}
|
||||
}
|
||||
else if (FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_BOAT) {
|
||||
if (pVehicle->GetVehicleAppearance() == VEHICLE_CAR ||
|
||||
pVehicle->GetVehicleAppearance() == VEHICLE_BIKE) {
|
||||
else if (FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_APPEARANCE_BOAT) {
|
||||
if (pVehicle->GetVehicleAppearance() == VEHICLE_APPEARANCE_CAR ||
|
||||
pVehicle->GetVehicleAppearance() == VEHICLE_APPEARANCE_BIKE) {
|
||||
pVehicle->AutoPilot.m_nTempAction = TEMPACT_WAIT;
|
||||
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 1000;
|
||||
}
|
||||
|
@ -655,10 +655,10 @@ CCarCtrl::GenerateOneRandomCar()
|
||||
}
|
||||
int nMadDrivers;
|
||||
switch (pVehicle->GetVehicleAppearance()) {
|
||||
case VEHICLE_BIKE:
|
||||
case VEHICLE_APPEARANCE_BIKE:
|
||||
nMadDrivers = 30;
|
||||
break;
|
||||
case VEHICLE_BOAT:
|
||||
case VEHICLE_APPEARANCE_BOAT:
|
||||
nMadDrivers = 40;
|
||||
break;
|
||||
default:
|
||||
|
@ -960,7 +960,7 @@ void CGarage::Update()
|
||||
if (m_pDoor1) {
|
||||
if (((CVector2D)FindPlayerVehicle()->GetPosition() - (CVector2D)m_pDoor1->GetPosition()).MagnitudeSqr() < SQR(DISTANCE_TO_SHOW_HIDEOUT_MESSAGE) &&
|
||||
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.
|
||||
CGarages::LastTimeHelpMessage = CTimer::GetTimeInMilliseconds();
|
||||
}
|
||||
|
@ -172,12 +172,12 @@ CPickup::GiveUsAPickUpObject(int32 handle)
|
||||
}
|
||||
|
||||
bool
|
||||
CPickup::CanBePickedUp(CPlayerPed *player)
|
||||
CPickup::CanBePickedUp(CPlayerPed *player, int playerId)
|
||||
{
|
||||
assert(m_pObject != nil);
|
||||
bool cannotBePickedUp =
|
||||
(m_pObject->GetModelIndex() == MI_PICKUP_BODYARMOUR && player->m_fArmour > 99.5f)
|
||||
|| (m_pObject->GetModelIndex() == MI_PICKUP_HEALTH && player->m_fHealth > 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 > CWorld::Players[playerId].m_nMaxHealth - 0.5f)
|
||||
|| (m_pObject->GetModelIndex() == MI_PICKUP_BRIBE && player->m_pWanted->m_nWantedLevel == 0)
|
||||
|| (m_pObject->GetModelIndex() == MI_PICKUP_KILLFRENZY && (CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame));
|
||||
return !cannotBePickedUp;
|
||||
@ -233,7 +233,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
|
||||
}
|
||||
|
||||
// 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);
|
||||
switch (m_eType)
|
||||
{
|
||||
@ -497,14 +497,14 @@ CPickups::GivePlayerGoodiesWithPickUpMI(int16 modelIndex, int playerIndex)
|
||||
DMAudio.PlayFrontEndSound(SOUND_PICKUP_ADRENALINE, 0);
|
||||
return true;
|
||||
} 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);
|
||||
return true;
|
||||
} else if (modelIndex == MI_PICKUP_INFO) {
|
||||
DMAudio.PlayFrontEndSound(SOUND_PICKUP_BONUS, 0);
|
||||
return true;
|
||||
} 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);
|
||||
return true;
|
||||
} else if (modelIndex == MI_PICKUP_BONUS) {
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
bool Update(CPlayerPed *player, CVehicle *vehicle, int playerId);
|
||||
private:
|
||||
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 Remove();
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -221,19 +221,17 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
SIZE_MAIN_SCRIPT = 128 * 1024,
|
||||
SIZE_MISSION_SCRIPT = 32 * 1024,
|
||||
SIZE_MAIN_SCRIPT = 225512,
|
||||
SIZE_MISSION_SCRIPT = 35000,
|
||||
SIZE_SCRIPT_SPACE = SIZE_MAIN_SCRIPT + SIZE_MISSION_SCRIPT
|
||||
};
|
||||
|
||||
enum {
|
||||
MAX_NUM_SCRIPTS = 128,
|
||||
MAX_NUM_CONTACTS = 16,
|
||||
MAX_NUM_INTRO_TEXT_LINES = 2,
|
||||
MAX_NUM_INTRO_RECTANGLES = 16,
|
||||
MAX_NUM_SCRIPT_SRPITES = 16,
|
||||
MAX_NUM_SCRIPT_SPHERES = 16,
|
||||
MAX_NUM_COLLECTIVES = 32,
|
||||
MAX_NUM_USED_OBJECTS = 200,
|
||||
MAX_NUM_MISSION_SCRIPTS = 120,
|
||||
MAX_NUM_BUILDING_SWAPS = 25,
|
||||
@ -245,13 +243,10 @@ class CTheScripts
|
||||
{
|
||||
static uint8 ScriptSpace[SIZE_SCRIPT_SPACE];
|
||||
static CRunningScript ScriptsArray[MAX_NUM_SCRIPTS];
|
||||
static int32 BaseBriefIdForContact[MAX_NUM_CONTACTS];
|
||||
static int32 OnAMissionForContactFlag[MAX_NUM_CONTACTS];
|
||||
static intro_text_line IntroTextLines[MAX_NUM_INTRO_TEXT_LINES];
|
||||
static intro_script_rectangle IntroRectangles[MAX_NUM_INTRO_RECTANGLES];
|
||||
static CSprite2d ScriptSprites[MAX_NUM_SCRIPT_SRPITES];
|
||||
static script_sphere_struct ScriptSphereArray[MAX_NUM_SCRIPT_SPHERES];
|
||||
static tCollectiveData CollectiveArray[MAX_NUM_COLLECTIVES];
|
||||
static tUsedObject UsedObjectArray[MAX_NUM_USED_OBJECTS];
|
||||
static int32 MultiScriptArray[MAX_NUM_MISSION_SCRIPTS];
|
||||
static tBuildingSwap BuildingSwapArray[MAX_NUM_BUILDING_SWAPS];
|
||||
@ -275,14 +270,17 @@ class CTheScripts
|
||||
static uint32 LargestMissionScriptSize;
|
||||
static uint32 MainScriptSize;
|
||||
static uint8 FailCurrentMission;
|
||||
static uint8 CountdownToMakePlayerUnsafe;
|
||||
static uint8 DelayMakingPlayerUnsafeThisTime;
|
||||
static uint16 NumScriptDebugLines;
|
||||
static uint16 NumberOfIntroRectanglesThisFrame;
|
||||
static uint16 NumberOfIntroTextLinesThisFrame;
|
||||
static uint8 UseTextCommands;
|
||||
static uint16 CommandsExecuted;
|
||||
static uint16 ScriptsUpdated;
|
||||
static uint8 RiotIntensity;
|
||||
static uint32 LastMissionPassedTime;
|
||||
static uint16 NumberOfExclusiveMissionScripts;
|
||||
static bool bPlayerIsInTheStatium;
|
||||
static bool bPlayerHasMetDebbieHarry;
|
||||
|
||||
public:
|
||||
static void Init();
|
||||
@ -306,9 +304,6 @@ public:
|
||||
|
||||
static int32* GetPointerToScriptVariable(int32 offset) { assert(offset >= 8 && offset < CTheScripts::GetSizeOfVariableSpace()); return (int32*)&ScriptSpace[offset]; }
|
||||
|
||||
static void ResetCountdownToMakePlayerUnsafe() { CountdownToMakePlayerUnsafe = 0; }
|
||||
static bool IsCountdownToMakePlayerUnsafeOn() { return CountdownToMakePlayerUnsafe != 0; }
|
||||
|
||||
static int32 Read4BytesFromScript(uint32* pIp) {
|
||||
int32 retval = ScriptSpace[*pIp + 3] << 24 | ScriptSpace[*pIp + 2] << 16 | ScriptSpace[*pIp + 1] << 8 | ScriptSpace[*pIp];
|
||||
*pIp += 4;
|
||||
@ -371,6 +366,7 @@ private:
|
||||
static int32 AddScriptSphere(int32 id, CVector pos, float radius);
|
||||
static int32 GetNewUniqueScriptSphereIndex(int32 index);
|
||||
static void RemoveScriptSphere(int32 index);
|
||||
static void RemoveScriptTextureDictionary();
|
||||
|
||||
friend class CRunningScript;
|
||||
friend class CHud;
|
||||
@ -414,6 +410,7 @@ class CRunningScript
|
||||
uint32 m_anStack[MAX_STACK_DEPTH];
|
||||
uint16 m_nStackPointer;
|
||||
int32 m_anLocalVariables[NUM_LOCAL_VARS + NUM_TIMERS];
|
||||
bool m_bIsActive;
|
||||
bool m_bCondResult;
|
||||
bool m_bIsMissionScript;
|
||||
bool m_bSkipWakeTime;
|
||||
@ -507,4 +504,6 @@ private:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static bool ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami);
|
||||
};
|
||||
|
Reference in New Issue
Block a user