mirror of
https://github.com/halpz/re3.git
synced 2025-10-06 18:21:42 +00:00
Merge branch 'master' of https://github.com/GTAmodding/re3
This commit is contained in:
@@ -2692,7 +2692,7 @@ void CCarCtrl::GenerateEmergencyServicesCar(void)
|
||||
float distance = 30.0f;
|
||||
CFire* pNearestFire = gFireManager.FindNearestFire(FindPlayerCoors(), &distance);
|
||||
if (pNearestFire) {
|
||||
if (CountCarsOfType(MI_FIRETRUCK) < 2 && CTimer::GetTimeInMilliseconds() > LastTimeFireTruckCreated + 30000){
|
||||
if (CountCarsOfType(MI_FIRETRUCK) < 2 && CTimer::GetTimeInMilliseconds() > LastTimeFireTruckCreated + 35000){
|
||||
CStreaming::RequestModel(MI_FIRETRUCK, STREAMFLAGS_DEPENDENCY);
|
||||
CStreaming::RequestModel(MI_FIREMAN, STREAMFLAGS_DONT_REMOVE);
|
||||
if (CStreaming::HasModelLoaded(MI_FIRETRUCK) && CStreaming::HasModelLoaded(MI_FIREMAN)){
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#include "Fire.h"
|
||||
#include "Script.h"
|
||||
#include "Garages.h"
|
||||
#include "screendroplets.h"
|
||||
|
||||
uint8 CGameLogic::ActivePlayers;
|
||||
|
||||
@@ -117,6 +118,9 @@ CGameLogic::Update()
|
||||
}
|
||||
}
|
||||
CEventList::Initialise();
|
||||
#ifdef SCREEN_DROPLETS
|
||||
ScreenDroplets::Initialise();
|
||||
#endif
|
||||
CMessages::ClearMessages();
|
||||
CCarCtrl::ClearInterestingVehicleList();
|
||||
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
|
||||
@@ -196,6 +200,9 @@ CGameLogic::Update()
|
||||
}
|
||||
}
|
||||
CEventList::Initialise();
|
||||
#ifdef SCREEN_DROPLETS
|
||||
ScreenDroplets::Initialise();
|
||||
#endif
|
||||
CMessages::ClearMessages();
|
||||
CCarCtrl::ClearInterestingVehicleList();
|
||||
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
|
||||
@@ -245,6 +252,9 @@ CGameLogic::Update()
|
||||
}
|
||||
}
|
||||
CEventList::Initialise();
|
||||
#ifdef SCREEN_DROPLETS
|
||||
ScreenDroplets::Initialise();
|
||||
#endif
|
||||
CMessages::ClearMessages();
|
||||
CCarCtrl::ClearInterestingVehicleList();
|
||||
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
|
||||
|
@@ -129,7 +129,7 @@ int32 CGarages::PoliceCarsCollected;
|
||||
CStoredCar CGarages::aCarsInSafeHouse1[NUM_GARAGE_STORED_CARS];
|
||||
CStoredCar CGarages::aCarsInSafeHouse2[NUM_GARAGE_STORED_CARS];
|
||||
CStoredCar CGarages::aCarsInSafeHouse3[NUM_GARAGE_STORED_CARS];
|
||||
int32 CGarages::AudioEntity = AEHANDLE_NONE;
|
||||
int32 hGarages = AEHANDLE_NONE;
|
||||
CGarage CGarages::aGarages[NUM_GARAGES];
|
||||
bool CGarages::bCamShouldBeOutisde;
|
||||
|
||||
@@ -156,12 +156,12 @@ void CGarages::Init(void)
|
||||
aCarsInSafeHouse2[i].Init();
|
||||
for (int i = 0; i < NUM_GARAGE_STORED_CARS; i++)
|
||||
aCarsInSafeHouse3[i].Init();
|
||||
AudioEntity = DMAudio.CreateEntity(AUDIOTYPE_GARAGE, (void*)1);
|
||||
if (AudioEntity >= 0)
|
||||
DMAudio.SetEntityStatus(AudioEntity, 1);
|
||||
hGarages = DMAudio.CreateEntity(AUDIOTYPE_GARAGE, (void*)1);
|
||||
if (hGarages >= 0)
|
||||
DMAudio.SetEntityStatus(hGarages, 1);
|
||||
AddOne(
|
||||
CRUSHER_GARAGE_X1, CRUSHER_GARAGE_Y1, CRUSHER_GARAGE_Z1,
|
||||
CRUSHER_GARAGE_X2, CRUSHER_GARAGE_Y2, CRUSHER_GARAGE_Z2,
|
||||
CVector(CRUSHER_GARAGE_X1, CRUSHER_GARAGE_Y1, CRUSHER_GARAGE_Z1),
|
||||
CVector(CRUSHER_GARAGE_X2, CRUSHER_GARAGE_Y2, CRUSHER_GARAGE_Z2),
|
||||
GARAGE_CRUSHER, 0);
|
||||
}
|
||||
|
||||
@@ -169,17 +169,17 @@ void CGarages::Init(void)
|
||||
void CGarages::Shutdown(void)
|
||||
{
|
||||
NumGarages = 0;
|
||||
if (AudioEntity < 0)
|
||||
if (hGarages < 0)
|
||||
return;
|
||||
DMAudio.DestroyEntity(AudioEntity);
|
||||
AudioEntity = AEHANDLE_NONE;
|
||||
DMAudio.DestroyEntity(hGarages);
|
||||
hGarages = AEHANDLE_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
void CGarages::Update(void)
|
||||
{
|
||||
static int GarageToBeTidied = 0;
|
||||
#ifndef PS2
|
||||
#ifndef GTA_PS2
|
||||
if (CReplay::IsPlayingBack())
|
||||
return;
|
||||
#endif
|
||||
@@ -202,23 +202,23 @@ void CGarages::Update(void)
|
||||
aGarages[GarageToBeTidied].TidyUpGarage();
|
||||
}
|
||||
|
||||
int16 CGarages::AddOne(float X1, float Y1, float Z1, float X2, float Y2, float Z2, eGarageType type, int32 targetId)
|
||||
int16 CGarages::AddOne(CVector p1, CVector p2, eGarageType type, int32 targetId)
|
||||
{
|
||||
if (NumGarages >= NUM_GARAGES) {
|
||||
assert(0);
|
||||
return NumGarages++;
|
||||
}
|
||||
CGarage* pGarage = &aGarages[NumGarages];
|
||||
pGarage->m_fX1 = Min(X1, X2);
|
||||
pGarage->m_fX2 = Max(X1, X2);
|
||||
pGarage->m_fY1 = Min(Y1, Y2);
|
||||
pGarage->m_fY2 = Max(Y1, Y2);
|
||||
pGarage->m_fZ1 = Min(Z1, Z2);
|
||||
pGarage->m_fZ2 = Max(Z1, Z2);
|
||||
pGarage->m_fX1 = Min(p1.x, p2.x);
|
||||
pGarage->m_fX2 = Max(p1.x, p2.x);
|
||||
pGarage->m_fY1 = Min(p1.y, p2.y);
|
||||
pGarage->m_fY2 = Max(p1.y, p2.y);
|
||||
pGarage->m_fZ1 = Min(p1.z, p2.z);
|
||||
pGarage->m_fZ2 = Max(p1.z, p2.z);
|
||||
pGarage->m_pDoor1 = nil;
|
||||
pGarage->m_pDoor2 = nil;
|
||||
pGarage->m_fDoor1Z = Z1;
|
||||
pGarage->m_fDoor2Z = Z1;
|
||||
pGarage->m_fDoor1Z = p1.z;
|
||||
pGarage->m_fDoor2Z = p1.z;
|
||||
pGarage->m_eGarageType = type;
|
||||
pGarage->m_bRecreateDoorOnNextRefresh = false;
|
||||
pGarage->m_bRotatedDoor = false;
|
||||
@@ -368,7 +368,7 @@ void CGarage::Update()
|
||||
if (m_fDoorPos == 0.0f) {
|
||||
m_eGarageState = GS_FULLYCLOSED;
|
||||
m_nTimeToStartAction = CTimer::GetTimeInMilliseconds() + TIME_TO_RESPRAY;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
CStats::CheckPointReachedSuccessfully();
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
@@ -464,7 +464,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(m_fDoorHeight, m_fDoorPos + (m_bRotatedDoor ? ROTATED_DOOR_OPEN_SPEED : DEFAULT_DOOR_OPEN_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == m_fDoorHeight) {
|
||||
m_eGarageState = GS_OPENEDCONTAINSCAR;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -510,7 +510,7 @@ void CGarage::Update()
|
||||
if (m_fDoorPos == 0.0f) {
|
||||
m_eGarageState = GS_FULLYCLOSED;
|
||||
m_nTimeToStartAction = CTimer::GetTimeInMilliseconds() + TIME_TO_SETUP_BOMB;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -575,7 +575,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(m_fDoorHeight, m_fDoorPos + (m_bRotatedDoor ? ROTATED_DOOR_OPEN_SPEED : DEFAULT_DOOR_OPEN_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == m_fDoorHeight) {
|
||||
m_eGarageState = GS_OPENEDCONTAINSCAR;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -599,7 +599,8 @@ void CGarage::Update()
|
||||
}
|
||||
}
|
||||
else if (!FindPlayerVehicle() && m_pTarget && IsEntityEntirelyInside3D(m_pTarget, 0.0f) &&
|
||||
!IsAnyOtherCarTouchingGarage(m_pTarget) && IsEntityEntirelyOutside(FindPlayerPed(), 2.0f)) {
|
||||
!IsAnyOtherCarTouchingGarage(m_pTarget) && IsEntityEntirelyOutside(FindPlayerPed(), 2.0f) &&
|
||||
!IsAnyOtherCarTouchingGarage(m_pTarget)) {
|
||||
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_GARAGE);
|
||||
FindPlayerPed()->m_pWanted->m_bIgnoredByCops = true;
|
||||
m_eGarageState = GS_CLOSING;
|
||||
@@ -609,7 +610,7 @@ void CGarage::Update()
|
||||
case GS_CLOSING:
|
||||
m_fDoorPos = Max(0.0f, m_fDoorPos - (m_bRotatedDoor ? ROTATED_DOOR_CLOSE_SPEED : DEFAULT_DOOR_CLOSE_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == 0.0f) {
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
if (m_bClosingWithoutTargetCar)
|
||||
m_eGarageState = GS_FULLYCLOSED;
|
||||
else {
|
||||
@@ -639,7 +640,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(m_fDoorHeight, m_fDoorPos + (m_bRotatedDoor ? ROTATED_DOOR_OPEN_SPEED : DEFAULT_DOOR_OPEN_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == m_fDoorHeight) {
|
||||
m_eGarageState = GS_OPENED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -676,7 +677,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Max(0.0f, m_fDoorPos - (m_bRotatedDoor ? ROTATED_DOOR_CLOSE_SPEED : DEFAULT_DOOR_CLOSE_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == 0.0f) {
|
||||
m_eGarageState = GS_FULLYCLOSED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
if (m_pTarget) {
|
||||
DestroyVehicleAndDriverAndPassengers(m_pTarget);
|
||||
m_pTarget = nil;
|
||||
@@ -723,7 +724,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(m_fDoorHeight, m_fDoorPos + (m_bRotatedDoor ? ROTATED_DOOR_OPEN_SPEED : DEFAULT_DOOR_OPEN_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == m_fDoorHeight) {
|
||||
m_eGarageState = GS_OPENED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -772,7 +773,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Max(0.0f, m_fDoorPos - (m_bRotatedDoor ? ROTATED_DOOR_CLOSE_SPEED : DEFAULT_DOOR_CLOSE_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == 0.0f) {
|
||||
m_eGarageState = GS_FULLYCLOSED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
if (m_pTarget) {
|
||||
MarkThisCarAsCollectedForCraig(m_pTarget->GetModelIndex());
|
||||
DestroyVehicleAndDriverAndPassengers(m_pTarget);
|
||||
@@ -812,7 +813,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(m_fDoorHeight, m_fDoorPos + (m_bRotatedDoor ? ROTATED_DOOR_OPEN_SPEED : DEFAULT_DOOR_OPEN_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == m_fDoorHeight) {
|
||||
m_eGarageState = GS_OPENED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -833,7 +834,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Max(0.0f, m_fDoorPos - (m_bRotatedDoor ? ROTATED_DOOR_CLOSE_SPEED : DEFAULT_DOOR_CLOSE_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == 0.0f) {
|
||||
m_eGarageState = GS_FULLYCLOSED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
}
|
||||
if (!IsGarageEmpty())
|
||||
m_eGarageState = GS_OPENING;
|
||||
@@ -844,7 +845,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(m_fDoorHeight, m_fDoorPos + (m_bRotatedDoor ? ROTATED_DOOR_OPEN_SPEED : DEFAULT_DOOR_OPEN_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == m_fDoorHeight) {
|
||||
m_eGarageState = GS_OPENED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -893,7 +894,7 @@ void CGarage::Update()
|
||||
m_pTarget = nil;
|
||||
m_eGarageState = GS_AFTERDROPOFF;
|
||||
m_nTimeToStartAction = CTimer::GetTimeInMilliseconds() + TIME_TO_CRUSH_CAR;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -913,7 +914,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(HALFPI, m_fDoorPos + CTimer::GetTimeStep() * CRUSHER_CRANE_SPEED);
|
||||
if (m_fDoorPos == HALFPI) {
|
||||
m_eGarageState = GS_OPENED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateCrusherAngle();
|
||||
break;
|
||||
@@ -945,7 +946,7 @@ void CGarage::Update()
|
||||
case GS_CLOSING:
|
||||
m_fDoorPos = Max(0.0f, m_fDoorPos - (m_bRotatedDoor ? ROTATED_DOOR_CLOSE_SPEED : DEFAULT_DOOR_CLOSE_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == 0.0f) {
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
if (m_bClosingWithoutTargetCar)
|
||||
m_eGarageState = GS_FULLYCLOSED;
|
||||
else {
|
||||
@@ -974,7 +975,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(m_fDoorHeight, m_fDoorPos + (m_bRotatedDoor ? ROTATED_DOOR_OPEN_SPEED : DEFAULT_DOOR_OPEN_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == m_fDoorHeight) {
|
||||
m_eGarageState = GS_OPENED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -994,7 +995,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(m_fDoorHeight, m_fDoorPos + (m_bRotatedDoor ? ROTATED_DOOR_OPEN_SPEED : DEFAULT_DOOR_OPEN_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == m_fDoorHeight) {
|
||||
m_eGarageState = GS_OPENED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -1014,7 +1015,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Max(0.0f, m_fDoorPos - (m_bRotatedDoor ? ROTATED_DOOR_CLOSE_SPEED : DEFAULT_DOOR_CLOSE_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == 0.0f) {
|
||||
m_eGarageState = GS_FULLYCLOSED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -1022,7 +1023,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(m_fDoorHeight, m_fDoorPos + (m_bRotatedDoor ? ROTATED_DOOR_OPEN_SPEED : DEFAULT_DOOR_OPEN_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == m_fDoorHeight) {
|
||||
m_eGarageState = GS_OPENED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -1045,8 +1046,8 @@ void CGarage::Update()
|
||||
// Close car doors either if player is far, or if he is in vehicle and garage is full,
|
||||
// or if player is very very far so that we can remove whatever is blocking garage door without him noticing
|
||||
if ((distance > SQR(DISTANCE_TO_CLOSE_HIDEOUT_GARAGE_IN_CAR) ||
|
||||
!FindPlayerVehicle() && distance > SQR(DISTANCE_TO_CLOSE_HIDEOUT_GARAGE_ON_FOOT) &&
|
||||
!IsAnyCarBlockingDoor()))
|
||||
!FindPlayerVehicle() && distance > SQR(DISTANCE_TO_CLOSE_HIDEOUT_GARAGE_ON_FOOT)) &&
|
||||
!IsAnyCarBlockingDoor())
|
||||
m_eGarageState = GS_CLOSING;
|
||||
else if (FindPlayerVehicle() &&
|
||||
CountCarsWithCenterPointWithinGarage(FindPlayerVehicle()) >=
|
||||
@@ -1064,7 +1065,7 @@ void CGarage::Update()
|
||||
if (!IsPlayerOutsideGarage())
|
||||
m_eGarageState = GS_OPENING;
|
||||
else if (m_fDoorPos == 0.0f) {
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
m_eGarageState = GS_FULLYCLOSED;
|
||||
switch (m_eGarageType) {
|
||||
case GARAGE_HIDEOUT_ONE: StoreAndRemoveCarsForThisHideout(CGarages::aCarsInSafeHouse1, MAX_STORED_CARS_IN_INDUSTRIAL); break;
|
||||
@@ -1111,7 +1112,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(m_fDoorHeight, m_fDoorPos + HIDEOUT_DOOR_SPEED_COEFFICIENT * (m_bRotatedDoor ? ROTATED_DOOR_OPEN_SPEED : DEFAULT_DOOR_OPEN_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == m_fDoorHeight) {
|
||||
m_eGarageState = GS_OPENED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -1136,7 +1137,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Max(0.0f, m_fDoorPos - (m_bRotatedDoor ? ROTATED_DOOR_CLOSE_SPEED : DEFAULT_DOOR_CLOSE_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == 0.0f) {
|
||||
m_eGarageState = GS_FULLYCLOSED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_CLOSED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -1152,7 +1153,7 @@ void CGarage::Update()
|
||||
m_fDoorPos = Min(m_fDoorHeight, m_fDoorPos + (m_bRotatedDoor ? ROTATED_DOOR_OPEN_SPEED : DEFAULT_DOOR_OPEN_SPEED) * CTimer::GetTimeStep());
|
||||
if (m_fDoorPos == m_fDoorHeight) {
|
||||
m_eGarageState = GS_OPENED;
|
||||
DMAudio.PlayOneShot(CGarages::AudioEntity, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
DMAudio.PlayOneShot(hGarages, SOUND_GARAGE_DOOR_OPENED, 1.0f);
|
||||
}
|
||||
UpdateDoorsHeight();
|
||||
break;
|
||||
@@ -1260,9 +1261,9 @@ bool CGarage::IsPlayerOutsideGarage()
|
||||
bool CGarage::IsEntityTouching3D(CEntity * pEntity)
|
||||
{
|
||||
float radius = pEntity->GetBoundRadius();
|
||||
if (pEntity->GetPosition().x - radius < m_fX1 || pEntity->GetPosition().x + radius > m_fX2 ||
|
||||
pEntity->GetPosition().y - radius < m_fY1 || pEntity->GetPosition().y + radius > m_fY2 ||
|
||||
pEntity->GetPosition().z - radius < m_fZ1 || pEntity->GetPosition().z + radius > m_fZ2)
|
||||
if (m_fX1 - radius > pEntity->GetPosition().x || m_fX2 + radius < pEntity->GetPosition().x ||
|
||||
m_fY1 - radius > pEntity->GetPosition().y || m_fY2 + radius < pEntity->GetPosition().y ||
|
||||
m_fZ1 - radius > pEntity->GetPosition().z || m_fZ2 + radius < pEntity->GetPosition().z)
|
||||
return false;
|
||||
CColModel* pColModel = pEntity->GetColModel();
|
||||
for (int i = 0; i < pColModel->numSpheres; i++) {
|
||||
@@ -1271,9 +1272,9 @@ bool CGarage::IsEntityTouching3D(CEntity * pEntity)
|
||||
if (pos.x + radius > m_fX1 && pos.x - radius < m_fX2 &&
|
||||
pos.y + radius > m_fY1 && pos.y - radius < m_fY2 &&
|
||||
pos.z + radius > m_fZ1 && pos.z - radius < m_fZ2)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CGarage::EntityHasASphereWayOutsideGarage(CEntity * pEntity, float fMargin)
|
||||
@@ -1387,7 +1388,9 @@ void CGarage::RemoveCarsBlockingDoorNotInside()
|
||||
if (!pVehicle->bIsLocked && pVehicle->CanBeDeleted()) {
|
||||
CWorld::Remove(pVehicle);
|
||||
delete pVehicle;
|
||||
return; // WHY?
|
||||
#ifndef FIX_BUGS
|
||||
return; // makes no sense
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1419,34 +1422,7 @@ void CGarages::PrintMessages()
|
||||
float y_offset = SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(84.0f); // This is PC and results in text being written over some HUD elements
|
||||
#endif
|
||||
|
||||
if (MessageNumberInString2 < 0) {
|
||||
if (MessageNumberInString < 0) {
|
||||
#ifdef FIX_BUGS
|
||||
CFont::PrintString(SCREEN_WIDTH / 2 - SCREEN_SCALE_X(2.0f), y_offset - SCREEN_SCALE_Y(2.0f), TheText.Get(MessageIDString));
|
||||
#else
|
||||
CFont::PrintString(SCREEN_WIDTH / 2 - 2.0f, y_offset - 2.0f, TheText.Get(MessageIDString));
|
||||
#endif
|
||||
CFont::SetColor(CRGBA(89, 115, 150, 255));
|
||||
CFont::PrintString(SCREEN_WIDTH / 2, y_offset, TheText.Get(MessageIDString));
|
||||
}
|
||||
else {
|
||||
CMessages::InsertNumberInString(TheText.Get(MessageIDString), MessageNumberInString, -1, -1, -1, -1, -1, gUString);
|
||||
#ifdef FIX_BUGS
|
||||
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), y_offset - SCREEN_SCALE_Y(40.0f) + SCREEN_SCALE_Y(2.0f), gUString);
|
||||
#else
|
||||
CFont::PrintString(SCREEN_WIDTH / 2 + 2.0f, y_offset - 40.0f + 2.0f, gUString);
|
||||
#endif
|
||||
|
||||
CFont::SetColor(CRGBA(89, 115, 150, 255));
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
CFont::PrintString(SCREEN_WIDTH / 2, y_offset - SCREEN_SCALE_Y(40.0f), gUString);
|
||||
#else
|
||||
CFont::PrintString(SCREEN_WIDTH / 2, y_offset - 40.0f, gUString);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (MessageNumberInString2 >= 0) {
|
||||
CMessages::InsertNumberInString(TheText.Get(MessageIDString), MessageNumberInString, MessageNumberInString2, -1, -1, -1, -1, gUString);
|
||||
#ifdef FIX_BUGS
|
||||
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), y_offset - SCREEN_SCALE_Y(40.0f) + SCREEN_SCALE_Y(2.0f), gUString);
|
||||
@@ -1460,6 +1436,31 @@ void CGarages::PrintMessages()
|
||||
CFont::PrintString(SCREEN_WIDTH / 2, y_offset - 40.0f, gUString);
|
||||
#endif
|
||||
}
|
||||
else if (MessageNumberInString >= 0) {
|
||||
CMessages::InsertNumberInString(TheText.Get(MessageIDString), MessageNumberInString, -1, -1, -1, -1, -1, gUString);
|
||||
#ifdef FIX_BUGS
|
||||
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), y_offset - SCREEN_SCALE_Y(40.0f) + SCREEN_SCALE_Y(2.0f), gUString);
|
||||
#else
|
||||
CFont::PrintString(SCREEN_WIDTH / 2 + 2.0f, y_offset - 40.0f + 2.0f, gUString);
|
||||
#endif
|
||||
|
||||
CFont::SetColor(CRGBA(89, 115, 150, 255));
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
CFont::PrintString(SCREEN_WIDTH / 2, y_offset - SCREEN_SCALE_Y(40.0f), gUString);
|
||||
#else
|
||||
CFont::PrintString(SCREEN_WIDTH / 2, y_offset - 40.0f, gUString);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#ifdef FIX_BUGS
|
||||
CFont::PrintString(SCREEN_WIDTH / 2 - SCREEN_SCALE_X(2.0f), y_offset - SCREEN_SCALE_Y(2.0f), TheText.Get(MessageIDString));
|
||||
#else
|
||||
CFont::PrintString(SCREEN_WIDTH / 2 - 2.0f, y_offset - 2.0f, TheText.Get(MessageIDString));
|
||||
#endif
|
||||
CFont::SetColor(CRGBA(89, 115, 150, 255));
|
||||
CFont::PrintString(SCREEN_WIDTH / 2, y_offset, TheText.Get(MessageIDString));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1534,41 +1535,54 @@ void CGarage::UpdateCrusherShake(float X, float Y)
|
||||
m_pDoor2->GetMatrix().GetPosition().y -= Y;
|
||||
}
|
||||
|
||||
// This is dumb but there is no way to avoid goto. What was there originally even?
|
||||
static bool DoINeedToRefreshPointer(CEntity * pDoor, bool bIsDummy, uint8 nIndex)
|
||||
{
|
||||
bool bNeedToFindDoorEntities = false;
|
||||
if (pDoor) {
|
||||
if (bIsDummy) {
|
||||
if (CPools::GetDummyPool()->IsFreeSlot(CPools::GetDummyPool()->GetJustIndex((CDummy*)pDoor)))
|
||||
return true;
|
||||
if (nIndex != (CPools::GetDummyPool()->GetIndex((CDummy*)pDoor) & 0x7F))
|
||||
bNeedToFindDoorEntities = true;
|
||||
if (!CGarages::IsModelIndexADoor(pDoor->GetModelIndex()))
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
if (CPools::GetObjectPool()->IsFreeSlot(CPools::GetObjectPool()->GetJustIndex((CObject*)pDoor)))
|
||||
return true;
|
||||
if (nIndex != (CPools::GetObjectPool()->GetIndex((CObject*)pDoor) & 0x7F))
|
||||
bNeedToFindDoorEntities = true;
|
||||
if (!CGarages::IsModelIndexADoor(pDoor->GetModelIndex()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return bNeedToFindDoorEntities;
|
||||
}
|
||||
|
||||
void CGarage::RefreshDoorPointers(bool bCreate)
|
||||
{
|
||||
bool bNeedToFindDoorEntities = true;
|
||||
if (!bCreate && !m_bRecreateDoorOnNextRefresh)
|
||||
bNeedToFindDoorEntities = false;
|
||||
bool bNeedToFindDoorEntities = bCreate || m_bRecreateDoorOnNextRefresh;
|
||||
m_bRecreateDoorOnNextRefresh = false;
|
||||
if (DoINeedToRefreshPointer(m_pDoor1, m_bDoor1IsDummy, m_bDoor1PoolIndex))
|
||||
bNeedToFindDoorEntities = true;
|
||||
if (DoINeedToRefreshPointer(m_pDoor2, m_bDoor2IsDummy, m_bDoor2PoolIndex))
|
||||
bNeedToFindDoorEntities = true;
|
||||
if (m_pDoor1) {
|
||||
if (m_bDoor1IsDummy) {
|
||||
if (CPools::GetDummyPool()->IsFreeSlot(CPools::GetDummyPool()->GetJustIndex_NoFreeAssert((CDummy*)m_pDoor1)))
|
||||
bNeedToFindDoorEntities = true;
|
||||
else {
|
||||
if (m_bDoor1PoolIndex != (CPools::GetDummyPool()->GetIndex((CDummy*)m_pDoor1) & 0x7F))
|
||||
bNeedToFindDoorEntities = true;
|
||||
if (!CGarages::IsModelIndexADoor(m_pDoor1->GetModelIndex()))
|
||||
bNeedToFindDoorEntities = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (CPools::GetObjectPool()->IsFreeSlot(CPools::GetObjectPool()->GetJustIndex_NoFreeAssert((CObject*)m_pDoor1)))
|
||||
bNeedToFindDoorEntities = true;
|
||||
else {
|
||||
if (m_bDoor1PoolIndex != (CPools::GetObjectPool()->GetIndex((CObject*)m_pDoor1) & 0x7F))
|
||||
bNeedToFindDoorEntities = true;
|
||||
if (!CGarages::IsModelIndexADoor(m_pDoor1->GetModelIndex()))
|
||||
bNeedToFindDoorEntities = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m_pDoor2) {
|
||||
if (m_bDoor2IsDummy) {
|
||||
if (CPools::GetDummyPool()->IsFreeSlot(CPools::GetDummyPool()->GetJustIndex_NoFreeAssert((CDummy*)m_pDoor2)))
|
||||
bNeedToFindDoorEntities = true;
|
||||
else {
|
||||
if (m_bDoor2PoolIndex != (CPools::GetDummyPool()->GetIndex((CDummy*)m_pDoor2) & 0x7F))
|
||||
bNeedToFindDoorEntities = true;
|
||||
if (!CGarages::IsModelIndexADoor(m_pDoor2->GetModelIndex()))
|
||||
bNeedToFindDoorEntities = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (CPools::GetObjectPool()->IsFreeSlot(CPools::GetObjectPool()->GetJustIndex_NoFreeAssert((CObject*)m_pDoor2)))
|
||||
bNeedToFindDoorEntities = true;
|
||||
else {
|
||||
if (m_bDoor2PoolIndex != (CPools::GetObjectPool()->GetIndex((CObject*)m_pDoor2) & 0x7F))
|
||||
bNeedToFindDoorEntities = true;
|
||||
if (!CGarages::IsModelIndexADoor(m_pDoor2->GetModelIndex()))
|
||||
bNeedToFindDoorEntities = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bNeedToFindDoorEntities)
|
||||
FindDoorsEntities();
|
||||
}
|
||||
|
@@ -198,7 +198,6 @@ class CGarages
|
||||
static CStoredCar aCarsInSafeHouse1[NUM_GARAGE_STORED_CARS];
|
||||
static CStoredCar aCarsInSafeHouse2[NUM_GARAGE_STORED_CARS];
|
||||
static CStoredCar aCarsInSafeHouse3[NUM_GARAGE_STORED_CARS];
|
||||
static int32 AudioEntity;
|
||||
static bool bCamShouldBeOutisde;
|
||||
|
||||
public:
|
||||
@@ -208,7 +207,7 @@ public:
|
||||
#endif
|
||||
static void Update(void);
|
||||
|
||||
static int16 AddOne(float X1, float Y1, float Z1, float X2, float Y2, float Z2, eGarageType type, int32 targetId);
|
||||
static int16 AddOne(CVector pos1, CVector pos2, eGarageType type, int32 targetId);
|
||||
static void ChangeGarageType(int16, eGarageType, int32);
|
||||
static void PrintMessages(void);
|
||||
static void TriggerMessage(const char* text, int16, uint16 time, int16);
|
||||
|
87
src/control/NameGrid.cpp
Normal file
87
src/control/NameGrid.cpp
Normal file
@@ -0,0 +1,87 @@
|
||||
#include "common.h"
|
||||
#include "NameGrid.h"
|
||||
|
||||
// TODO: reverse mobile code
|
||||
|
||||
CPlayerName::CPlayerName()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerName::DisplayName(int)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
CRow::CRow()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void
|
||||
CRow::SetLetter(int, wchar *)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
CGrid::CGrid()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void
|
||||
CGrid::ProcessAnyLeftJustDown()
|
||||
{
|
||||
unk_int2--;
|
||||
}
|
||||
|
||||
void
|
||||
CGrid::ProcessAnyRightJustDown()
|
||||
{
|
||||
unk_int2++;
|
||||
}
|
||||
|
||||
void
|
||||
CGrid::ProcessAnyUpJustDown()
|
||||
{
|
||||
unk_int1--;
|
||||
}
|
||||
|
||||
void
|
||||
CGrid::ProcessAnyDownJustDown()
|
||||
{
|
||||
unk_int1++;
|
||||
}
|
||||
|
||||
void
|
||||
CGrid::AllDoneMakePlayerName()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void
|
||||
CGrid::ProcessDPadCrossJustDown()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void
|
||||
CGrid::DisplayGrid()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void
|
||||
CGrid::ProcessControllerInput()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void
|
||||
CGrid::Process()
|
||||
{
|
||||
ProcessControllerInput();
|
||||
DisplayGrid();
|
||||
playerName.DisplayName(2 * playerName.unk_4c);
|
||||
}
|
53
src/control/NameGrid.h
Normal file
53
src/control/NameGrid.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
// TODO: reverse mobile code
|
||||
|
||||
class CPlayerName
|
||||
{
|
||||
friend class CGrid;
|
||||
|
||||
float x;
|
||||
float y;
|
||||
wchar unk_8[34];
|
||||
int unk_4c;
|
||||
public:
|
||||
CPlayerName();
|
||||
void DisplayName(int);
|
||||
};
|
||||
|
||||
class CRow
|
||||
{
|
||||
friend class CGrid;
|
||||
|
||||
int unk_0;
|
||||
int unk_4;
|
||||
wchar unk_8[20];
|
||||
int unk_30;
|
||||
public:
|
||||
CRow();
|
||||
void SetLetter(int, wchar *);
|
||||
};
|
||||
|
||||
class CGrid
|
||||
{
|
||||
CRow rows[5];
|
||||
int unk_int1;
|
||||
int unk_int2;
|
||||
int unk_int3;
|
||||
float unk_float1;
|
||||
float unk_float2;
|
||||
CPlayerName playerName;
|
||||
char unk2[4];
|
||||
char unk3[4];
|
||||
public:
|
||||
CGrid();
|
||||
void ProcessAnyLeftJustDown();
|
||||
void ProcessAnyRightJustDown();
|
||||
void ProcessAnyUpJustDown();
|
||||
void ProcessAnyDownJustDown();
|
||||
void AllDoneMakePlayerName();
|
||||
void ProcessDPadCrossJustDown();
|
||||
void DisplayGrid();
|
||||
void ProcessControllerInput();
|
||||
void Process();
|
||||
};
|
@@ -542,6 +542,22 @@ CPathFind::PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoFor
|
||||
int done, cont;
|
||||
int tileStart;
|
||||
|
||||
#ifndef MASTER
|
||||
for (i = 0; i < m_numMapObjects-1; i++)
|
||||
for (j = i+1; j < m_numMapObjects; j++) {
|
||||
CTreadable *obj1 = m_mapObjects[i];
|
||||
CTreadable *obj2 = m_mapObjects[j];
|
||||
if (obj1->GetModelIndex() == obj2->GetModelIndex() &&
|
||||
obj1->GetPosition().x == obj2->GetPosition().x && obj1->GetPosition().y == obj2->GetPosition().y && obj1->GetPosition().z == obj2->GetPosition().z &&
|
||||
obj1->GetRight().x == obj2->GetRight().x && obj1->GetForward().x == obj2->GetForward().x && obj1->GetUp().x == obj2->GetUp().x &&
|
||||
obj1->GetRight().y == obj2->GetRight().y && obj1->GetForward().y == obj2->GetForward().y && obj1->GetUp().y == obj2->GetUp().y &&
|
||||
obj1->GetRight().z == obj2->GetRight().z && obj1->GetForward().z == obj2->GetForward().z && obj1->GetUp().z == obj2->GetUp().z) {
|
||||
printf("THIS IS VERY BAD INDEED. FIX IMMEDIATELY!!!\n");
|
||||
printf("Double road objects at the following coors: %f %f %f\n", obj1->GetPosition().x, obj1->GetPosition().y, obj1->GetPosition().z);
|
||||
}
|
||||
}
|
||||
#endif // !MASTER
|
||||
|
||||
oldNumPathNodes = m_numPathNodes;
|
||||
oldNumLinks = m_numConnections;
|
||||
|
||||
@@ -1633,10 +1649,18 @@ CPathFind::TestCoorsCloseness(CVector target, uint8 type, CVector start)
|
||||
DoPathSearch(type, start, -1, target, pNodeList, &DummyResult, 32, nil, &dist, 999999.88f, -1);
|
||||
else
|
||||
DoPathSearch(type, start, -1, target, nil, &DummyResult2, 0, nil, &dist, 50.0f, -1);
|
||||
#ifdef FIX_BUGS
|
||||
// dist has GenerationDistMultiplier as a factor, so our reference dist should have it too
|
||||
if(type == PATH_CAR)
|
||||
return dist < 160.0f*TheCamera.GenerationDistMultiplier;
|
||||
else
|
||||
return dist < 100.0f*TheCamera.GenerationDistMultiplier;
|
||||
#else
|
||||
if(type == PATH_CAR)
|
||||
return dist < 160.0f;
|
||||
else
|
||||
return dist < 100.0f;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -387,7 +387,7 @@ INITSAVEBUF
|
||||
|
||||
// Convert entity pointer to building pool index while saving
|
||||
if (phone->m_pEntity) {
|
||||
phone->m_pEntity = (CEntity*) (CPools::GetBuildingPool()->GetJustIndex((CBuilding*)phone->m_pEntity) + 1);
|
||||
phone->m_pEntity = (CEntity*) (CPools::GetBuildingPool()->GetJustIndex_NoFreeAssert((CBuilding*)phone->m_pEntity) + 1);
|
||||
}
|
||||
}
|
||||
VALIDATESAVEBUF(*size)
|
||||
|
@@ -353,11 +353,11 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
|
||||
|
||||
m_pObject->GetMatrix().UpdateRW();
|
||||
m_pObject->UpdateRwFrame();
|
||||
if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, 0) && waterLevel >= m_pObject->GetPosition().z)
|
||||
if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, false) && waterLevel >= m_pObject->GetPosition().z)
|
||||
m_eType = PICKUP_FLOATINGPACKAGE_FLOATING;
|
||||
break;
|
||||
case PICKUP_FLOATINGPACKAGE_FLOATING:
|
||||
if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, 0))
|
||||
if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, false))
|
||||
m_pObject->GetMatrix().GetPosition().z = waterLevel;
|
||||
|
||||
m_pObject->GetMatrix().UpdateRW();
|
||||
@@ -1013,7 +1013,7 @@ INITSAVEBUF
|
||||
for (int32 i = 0; i < NUMPICKUPS; i++) {
|
||||
CPickup *buf_pickup = WriteSaveBuf(buf, aPickUps[i]);
|
||||
if (buf_pickup->m_eType != PICKUP_NONE && buf_pickup->m_pObject != nil)
|
||||
buf_pickup->m_pObject = (CObject*)(CPools::GetObjectPool()->GetJustIndex(buf_pickup->m_pObject) + 1);
|
||||
buf_pickup->m_pObject = (CObject*)(CPools::GetObjectPool()->GetJustIndex_NoFreeAssert(buf_pickup->m_pObject) + 1);
|
||||
}
|
||||
|
||||
WriteSaveBuf(buf, CollectedPickUpIndex);
|
||||
@@ -1436,3 +1436,85 @@ CPacManPickups::ResetPowerPillsCarriedByPlayer()
|
||||
FindPlayerVehicle()->m_fForceMultiplier = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CPed::CreateDeadPedMoney(void)
|
||||
{
|
||||
if (!CGame::nastyGame)
|
||||
return;
|
||||
|
||||
int mi = GetModelIndex();
|
||||
|
||||
if ((mi >= MI_COP && mi <= MI_FIREMAN) || CharCreatedBy == MISSION_CHAR || bInVehicle)
|
||||
return;
|
||||
|
||||
int money = CGeneral::GetRandomNumber() % 60;
|
||||
if (money < 10)
|
||||
return;
|
||||
|
||||
if (money == 43)
|
||||
money = 700;
|
||||
|
||||
int pickupCount = money / 40 + 1;
|
||||
int moneyPerPickup = money / pickupCount;
|
||||
|
||||
for(int i = 0; i < pickupCount; i++) {
|
||||
// (CGeneral::GetRandomNumber() % 256) * PI / 128 gives a float up to something TWOPI-ish.
|
||||
float pickupX = 1.5f * Sin((CGeneral::GetRandomNumber() % 256) * PI / 128) + GetPosition().x;
|
||||
float pickupY = 1.5f * Cos((CGeneral::GetRandomNumber() % 256) * PI / 128) + GetPosition().y;
|
||||
bool found = false;
|
||||
float groundZ = CWorld::FindGroundZFor3DCoord(pickupX, pickupY, GetPosition().z, &found) + 0.5f;
|
||||
if (found) {
|
||||
CPickups::GenerateNewOne(CVector(pickupX, pickupY, groundZ), MI_MONEY, PICKUP_MONEY, moneyPerPickup + (CGeneral::GetRandomNumber() & 7));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CPed::CreateDeadPedWeaponPickups(void)
|
||||
{
|
||||
bool found = false;
|
||||
float angleToPed;
|
||||
CVector pickupPos;
|
||||
|
||||
if (bInVehicle)
|
||||
return;
|
||||
|
||||
for(int i = 0; i < WEAPONTYPE_TOTAL_INVENTORY_WEAPONS; i++) {
|
||||
|
||||
eWeaponType weapon = GetWeapon(i).m_eWeaponType;
|
||||
int weaponAmmo = GetWeapon(i).m_nAmmoTotal;
|
||||
if (weapon == WEAPONTYPE_UNARMED || weapon == WEAPONTYPE_DETONATOR || weaponAmmo == 0)
|
||||
continue;
|
||||
|
||||
angleToPed = i * 1.75f;
|
||||
pickupPos = GetPosition();
|
||||
pickupPos.x += 1.5f * Sin(angleToPed);
|
||||
pickupPos.y += 1.5f * Cos(angleToPed);
|
||||
pickupPos.z = CWorld::FindGroundZFor3DCoord(pickupPos.x, pickupPos.y, pickupPos.z, &found) + 0.5f;
|
||||
|
||||
CVector pedPos = GetPosition();
|
||||
pedPos.z += 0.3f;
|
||||
|
||||
CVector pedToPickup = pickupPos - pedPos;
|
||||
float distance = pedToPickup.Magnitude();
|
||||
|
||||
// outer edge of pickup
|
||||
distance = (distance + 0.3f) / distance;
|
||||
CVector pickupPos2 = pedPos;
|
||||
pickupPos2 += distance * pedToPickup;
|
||||
|
||||
// pickup must be on ground and line to its edge must be clear
|
||||
if (!found || CWorld::GetIsLineOfSightClear(pickupPos2, pedPos, true, false, false, false, false, false, false)) {
|
||||
// otherwise try another position (but disregard second check apparently)
|
||||
angleToPed += 3.14f;
|
||||
pickupPos = GetPosition();
|
||||
pickupPos.x += 1.5f * Sin(angleToPed);
|
||||
pickupPos.y += 1.5f * Cos(angleToPed);
|
||||
pickupPos.z = CWorld::FindGroundZFor3DCoord(pickupPos.x, pickupPos.y, pickupPos.z, &found) + 0.5f;
|
||||
}
|
||||
if (found)
|
||||
CPickups::GenerateNewOne_WeaponType(pickupPos, weapon, PICKUP_ONCE_TIMEOUT, Min(weaponAmmo, AmmoForWeapon_OnStreet[weapon]));
|
||||
}
|
||||
ClearWeapons();
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
#include "common.h"
|
||||
|
||||
#ifdef GTA_REPLAY
|
||||
#include "AnimBlendAssociation.h"
|
||||
#include "Boat.h"
|
||||
#include "SpecialFX.h"
|
||||
@@ -1585,3 +1585,4 @@ void CReplay::Display()
|
||||
if (Mode == MODE_PLAYBACK)
|
||||
CFont::PrintString(SCREEN_SCALE_X(63.5f), SCREEN_SCALE_Y(30.0f), TheText.Get("REPLAY"));
|
||||
}
|
||||
#endif
|
||||
|
@@ -63,6 +63,12 @@ struct CStoredDetailedAnimationState
|
||||
|
||||
void PlayReplayFromHD(void);
|
||||
|
||||
#ifdef GTA_REPLAY
|
||||
#define REPLAY_STUB
|
||||
#else
|
||||
#define REPLAY_STUB {}
|
||||
#endif
|
||||
|
||||
class CReplay
|
||||
{
|
||||
enum {
|
||||
@@ -273,20 +279,24 @@ private:
|
||||
#endif
|
||||
|
||||
public:
|
||||
static void Init(void);
|
||||
static void DisableReplays(void);
|
||||
static void EnableReplays(void);
|
||||
static void Update(void);
|
||||
static void FinishPlayback(void);
|
||||
static void EmptyReplayBuffer(void);
|
||||
static void Display(void);
|
||||
static void TriggerPlayback(uint8 cam_mode, float cam_x, float cam_y, float cam_z, bool load_scene);
|
||||
static void StreamAllNecessaryCarsAndPeds(void);
|
||||
static bool ShouldStandardCameraBeProcessed(void);
|
||||
static void Init(void) REPLAY_STUB;
|
||||
static void DisableReplays(void) REPLAY_STUB;
|
||||
static void EnableReplays(void) REPLAY_STUB;
|
||||
static void Update(void) REPLAY_STUB;
|
||||
static void FinishPlayback(void) REPLAY_STUB;
|
||||
static void EmptyReplayBuffer(void) REPLAY_STUB;
|
||||
static void Display(void) REPLAY_STUB;
|
||||
static void TriggerPlayback(uint8 cam_mode, float cam_x, float cam_y, float cam_z, bool load_scene) REPLAY_STUB;
|
||||
static void StreamAllNecessaryCarsAndPeds(void) REPLAY_STUB;
|
||||
|
||||
#ifndef GTA_REPLAY
|
||||
static bool ShouldStandardCameraBeProcessed(void) { return true; }
|
||||
static bool IsPlayingBack() { return false; }
|
||||
static bool IsPlayingBackFromFile() { return false; }
|
||||
#else
|
||||
static bool ShouldStandardCameraBeProcessed(void);
|
||||
static bool IsPlayingBack() { return Mode == MODE_PLAYBACK; }
|
||||
static bool IsPlayingBackFromFile() { return bPlayingBackFromFile; }
|
||||
|
||||
private:
|
||||
static void RecordThisFrame(void);
|
||||
static void StorePedUpdate(CPed *ped, int id);
|
||||
@@ -314,4 +324,5 @@ private:
|
||||
|
||||
/* Absolute nonsense, but how could this function end up being outside of class? */
|
||||
friend void PlayReplayFromHD(void);
|
||||
#endif
|
||||
};
|
||||
|
@@ -81,7 +81,7 @@ CRestart::FindClosestHospitalRestartPoint(const CVector &pos, CVector *outPos, f
|
||||
}
|
||||
|
||||
eLevelName curlevel = CTheZones::FindZoneForPoint(pos);
|
||||
float fMinDist = 16000000.0f;
|
||||
float fMinDist = SQR(4000.0f);
|
||||
int closestPoint = NUM_RESTART_POINTS;
|
||||
|
||||
// find closest point on this level
|
||||
@@ -128,7 +128,7 @@ CRestart::FindClosestPoliceRestartPoint(const CVector &pos, CVector *outPos, flo
|
||||
}
|
||||
|
||||
eLevelName curlevel = CTheZones::FindZoneForPoint(pos);
|
||||
float fMinDist = 16000000.0f;
|
||||
float fMinDist = SQR(4000.0f);
|
||||
int closestPoint = NUM_RESTART_POINTS;
|
||||
|
||||
// find closest point on this level
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "common.h"
|
||||
|
||||
#include "SceneEdit.h"
|
||||
|
||||
#ifdef GTA_SCENE_EDIT
|
||||
#include "Automobile.h"
|
||||
#include "Camera.h"
|
||||
#include "CarCtrl.h"
|
||||
@@ -1096,3 +1096,4 @@ bool CSceneEdit::SelectWeapon(void)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef GTA_SCENE_EDIT
|
||||
class CPed;
|
||||
class CVehicle;
|
||||
|
||||
@@ -93,3 +93,4 @@ public:
|
||||
static void SelectVehicle(void);
|
||||
static bool SelectWeapon(void);
|
||||
};
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,29 @@ class CPlayerInfo;
|
||||
|
||||
class CRunningScript;
|
||||
|
||||
extern int32 ScriptParams[32];
|
||||
|
||||
void FlushLog();
|
||||
#define script_assert(_Expression) FlushLog(); assert(_Expression);
|
||||
|
||||
#define PICKUP_PLACEMENT_OFFSET 0.5f
|
||||
#define PED_FIND_Z_OFFSET 5.0f
|
||||
|
||||
#define SPHERE_MARKER_R 0
|
||||
#define SPHERE_MARKER_G 128
|
||||
#define SPHERE_MARKER_B 255
|
||||
#define SPHERE_MARKER_A 128
|
||||
#define SPHERE_MARKER_PULSE_PERIOD 2048
|
||||
#define SPHERE_MARKER_PULSE_FRACTION 0.1f
|
||||
|
||||
#ifdef USE_PRECISE_MEASUREMENT_CONVERTION
|
||||
#define METERS_IN_FOOT 0.3048f
|
||||
#define FEET_IN_METER 3.28084f
|
||||
#else
|
||||
#define METERS_IN_FOOT 0.3f
|
||||
#define FEET_IN_METER 3.33f
|
||||
#endif
|
||||
|
||||
#define KEY_LENGTH_IN_SCRIPT 8
|
||||
|
||||
struct intro_script_rectangle
|
||||
@@ -376,6 +399,11 @@ private:
|
||||
#ifdef FIX_BUGS
|
||||
friend void RetryMission(int, int);
|
||||
#endif
|
||||
|
||||
#ifdef MISSION_SWITCHER
|
||||
public:
|
||||
static void SwitchToMission(int32 mission);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -514,6 +542,8 @@ private:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
friend class CTheScripts;
|
||||
};
|
||||
|
||||
#ifdef MISSION_REPLAY
|
||||
|
1555
src/control/Script2.cpp
Normal file
1555
src/control/Script2.cpp
Normal file
File diff suppressed because it is too large
Load Diff
2082
src/control/Script3.cpp
Normal file
2082
src/control/Script3.cpp
Normal file
File diff suppressed because it is too large
Load Diff
2027
src/control/Script4.cpp
Normal file
2027
src/control/Script4.cpp
Normal file
File diff suppressed because it is too large
Load Diff
2011
src/control/Script5.cpp
Normal file
2011
src/control/Script5.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1343
src/control/Script6.cpp
Normal file
1343
src/control/Script6.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1156,7 +1156,7 @@ enum {
|
||||
COMMAND_IS_CHAR_LYING_DOWN,
|
||||
COMMAND_CAN_CHAR_SEE_DEAD_CHAR,
|
||||
COMMAND_SET_ENTER_CAR_RANGE_MULTIPLIER,
|
||||
#ifndef GTA3_1_1_PATCH
|
||||
#if GTA_VERSION < GTA3_PC_11
|
||||
COMMAND_SET_THREAT_REACTION_RANGE_MULTIPLIER,
|
||||
#endif
|
||||
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
||||
|
Reference in New Issue
Block a user