Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Nikolay Korolev 2020-05-02 18:02:45 +03:00
commit 7d067684ff
39 changed files with 2522 additions and 2721 deletions

View File

@ -267,11 +267,11 @@ CCutsceneMgr::SetupCutsceneToStart(void)
assert(RwObjectGetType(ms_pCutsceneObjects[i]->m_rwObject) == rpCLUMP); assert(RwObjectGetType(ms_pCutsceneObjects[i]->m_rwObject) == rpCLUMP);
if (CAnimBlendAssociation *pAnimBlendAssoc = RpAnimBlendClumpGetFirstAssociation((RpClump*)ms_pCutsceneObjects[i]->m_rwObject)) { if (CAnimBlendAssociation *pAnimBlendAssoc = RpAnimBlendClumpGetFirstAssociation((RpClump*)ms_pCutsceneObjects[i]->m_rwObject)) {
assert(pAnimBlendAssoc->hierarchy->sequences[0].HasTranslation()); assert(pAnimBlendAssoc->hierarchy->sequences[0].HasTranslation());
ms_pCutsceneObjects[i]->GetPosition() = ms_cutsceneOffset + ((KeyFrameTrans*)pAnimBlendAssoc->hierarchy->sequences[0].GetKeyFrame(0))->translation; ms_pCutsceneObjects[i]->SetPosition(ms_cutsceneOffset + ((KeyFrameTrans*)pAnimBlendAssoc->hierarchy->sequences[0].GetKeyFrame(0))->translation);
CWorld::Add(ms_pCutsceneObjects[i]); CWorld::Add(ms_pCutsceneObjects[i]);
pAnimBlendAssoc->SetRun(); pAnimBlendAssoc->SetRun();
} else { } else {
ms_pCutsceneObjects[i]->GetPosition() = ms_cutsceneOffset; ms_pCutsceneObjects[i]->SetPosition(ms_cutsceneOffset);
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -167,7 +167,7 @@ public:
bool m_bTimerJustReset; bool m_bTimerJustReset;
int32 m_nTimer; int32 m_nTimer;
tSound m_sQueueSample; tSound m_sQueueSample;
bool m_bActiveSampleQueue; uint8 m_nActiveSampleQueue;
tSound m_asSamples[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS]; tSound m_asSamples[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS];
uint8 m_abSampleQueueIndexTable[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS]; uint8 m_abSampleQueueIndexTable[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS];
uint8 m_SampleRequestQueuesStatus[NUM_SOUNDS_SAMPLES_BANKS]; uint8 m_SampleRequestQueuesStatus[NUM_SOUNDS_SAMPLES_BANKS];
@ -202,6 +202,7 @@ public:
uint32 GetFrameCounter() const { return m_FrameCounter; } uint32 GetFrameCounter() const { return m_FrameCounter; }
float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; } float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; }
int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; } int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; }
int32 GetRandomNumberInRange(int32 idx, int32 low, int32 high) const { return (m_anRandomTable[idx] % (high - low + 1)) + low; }
bool IsMissionAudioPlaying() const { return m_sMissionAudio.m_nPlayStatus == 1; } bool IsMissionAudioPlaying() const { return m_sMissionAudio.m_nPlayStatus == 1; }
// "Should" be in alphabetic order, except "getXTalkSfx" // "Should" be in alphabetic order, except "getXTalkSfx"
@ -456,7 +457,7 @@ public:
void SetupSuspectLastSeenReport(); void SetupSuspectLastSeenReport();
void Terminate(); void Terminate();
void TranslateEntity(CVector *v1, CVector *v2) const; void TranslateEntity(Const CVector *v1, CVector *v2) const;
void UpdateGasPedalAudio(CAutomobile *automobile); void UpdateGasPedalAudio(CAutomobile *automobile);
void UpdateReflections(); void UpdateReflections();

View File

@ -140,7 +140,7 @@ enum eSound : int16
SOUND_PED_TAXI_CALL = 135, SOUND_PED_TAXI_CALL = 135,
SOUND_INJURED_PED_MALE_OUCH = 136, SOUND_INJURED_PED_MALE_OUCH = 136,
SOUND_INJURED_PED_FEMALE = 137, SOUND_INJURED_PED_FEMALE = 137,
SOUND_8A = 138, SOUND_INJURED_PED_MALE_PRISON = 138,
SOUND_RACE_START_3 = 139, SOUND_RACE_START_3 = 139,
SOUND_RACE_START_2 = 140, SOUND_RACE_START_2 = 140,
SOUND_RACE_START_1 = 141, SOUND_RACE_START_1 = 141,

View File

@ -93,16 +93,16 @@ void CBridge::Update()
// Move bridge part // Move bridge part
if (liftHeight != OldLift) if (liftHeight != OldLift)
{ {
pLiftPart->GetPosition().z = DefaultZLiftPart + liftHeight; pLiftPart->GetMatrix().GetPosition().z = DefaultZLiftPart + liftHeight;
pLiftPart->GetMatrix().UpdateRW(); pLiftPart->GetMatrix().UpdateRW();
pLiftPart->UpdateRwFrame(); pLiftPart->UpdateRwFrame();
if (pLiftRoad) if (pLiftRoad)
{ {
pLiftRoad->GetPosition().z = DefaultZLiftRoad + liftHeight; pLiftRoad->GetMatrix().GetPosition().z = DefaultZLiftRoad + liftHeight;
pLiftRoad->GetMatrix().UpdateRW(); pLiftRoad->GetMatrix().UpdateRW();
pLiftRoad->UpdateRwFrame(); pLiftRoad->UpdateRwFrame();
} }
pWeight->GetPosition().z = DefaultZLiftWeight - liftHeight; pWeight->GetMatrix().GetPosition().z = DefaultZLiftWeight - liftHeight;
pWeight->GetMatrix().UpdateRW(); pWeight->GetMatrix().UpdateRW();
pWeight->UpdateRwFrame(); pWeight->UpdateRwFrame();

View File

@ -461,7 +461,7 @@ CCarCtrl::GenerateOneRandomCar()
return; return;
} }
finalPosition.z = groundZ + pCar->GetHeightAboveRoad(); finalPosition.z = groundZ + pCar->GetHeightAboveRoad();
pCar->GetPosition() = finalPosition; pCar->SetPosition(finalPosition);
pCar->SetMoveSpeed(directionIncludingCurve / GAME_SPEED_TO_CARAI_SPEED); pCar->SetMoveSpeed(directionIncludingCurve / GAME_SPEED_TO_CARAI_SPEED);
CVector2D speedDifferenceWithTarget = (CVector2D)pCar->GetMoveSpeed() - vecPlayerSpeed; CVector2D speedDifferenceWithTarget = (CVector2D)pCar->GetMoveSpeed() - vecPlayerSpeed;
CVector2D distanceToTarget = positionIncludingCurve - vecTargetPos; CVector2D distanceToTarget = positionIncludingCurve - vecTargetPos;
@ -1964,9 +1964,8 @@ void CCarCtrl::DragCarToPoint(CVehicle* pVehicle, CVector* pPoint)
pVehicle->GetRight() = CVector(posTarget.y - midPos.y, -(posTarget.x - midPos.x), 0.0f) / 3; pVehicle->GetRight() = CVector(posTarget.y - midPos.y, -(posTarget.x - midPos.x), 0.0f) / 3;
pVehicle->GetForward() = CVector(-cosZ * pVehicle->GetRight().y, cosZ * pVehicle->GetRight().x, sinZ); pVehicle->GetForward() = CVector(-cosZ * pVehicle->GetRight().y, cosZ * pVehicle->GetRight().x, sinZ);
pVehicle->GetUp() = CrossProduct(pVehicle->GetRight(), pVehicle->GetForward()); pVehicle->GetUp() = CrossProduct(pVehicle->GetRight(), pVehicle->GetForward());
pVehicle->GetPosition() = (CVector(midPos.x, midPos.y, actualBehindZ) pVehicle->SetPosition((CVector(midPos.x, midPos.y, actualBehindZ) + CVector(posTarget.x, posTarget.y, actualAheadZ)) / 2);
+ CVector(posTarget.x, posTarget.y, actualAheadZ)) / 2; pVehicle->GetMatrix().GetPosition().z += pVehicle->GetHeightAboveRoad();
pVehicle->GetPosition().z += pVehicle->GetHeightAboveRoad();
} }
float CCarCtrl::FindSpeedMultiplier(float angleChange, float minAngle, float maxAngle, float coef) float CCarCtrl::FindSpeedMultiplier(float angleChange, float minAngle, float maxAngle, float coef)
@ -2647,7 +2646,7 @@ bool CCarCtrl::GenerateOneEmergencyServicesCar(uint32 mi, CVector vecPos)
return nil; return nil;
CAutomobile* pVehicle = new CAutomobile(mi, RANDOM_VEHICLE); CAutomobile* pVehicle = new CAutomobile(mi, RANDOM_VEHICLE);
pVehicle->AutoPilot.m_vecDestinationCoors = vecPos; pVehicle->AutoPilot.m_vecDestinationCoors = vecPos;
pVehicle->GetPosition() = spawnPos; pVehicle->SetPosition(spawnPos);
pVehicle->AutoPilot.m_nCarMission = (JoinCarWithRoadSystemGotoCoors(pVehicle, vecPos, false)) ? MISSION_GOTOCOORDS_STRAIGHT : MISSION_GOTOCOORDS; pVehicle->AutoPilot.m_nCarMission = (JoinCarWithRoadSystemGotoCoors(pVehicle, vecPos, false)) ? MISSION_GOTOCOORDS_STRAIGHT : MISSION_GOTOCOORDS;
pVehicle->AutoPilot.m_fMaxTrafficSpeed = pVehicle->AutoPilot.m_nCruiseSpeed = 25; pVehicle->AutoPilot.m_fMaxTrafficSpeed = pVehicle->AutoPilot.m_nCruiseSpeed = 25;
pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE; pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE;
@ -2672,7 +2671,7 @@ bool CCarCtrl::GenerateOneEmergencyServicesCar(uint32 mi, CVector vecPos)
return false; return false;
} }
spawnPos.z = groundZ + pVehicle->GetDistanceFromCentreOfMassToBaseOfModel(); spawnPos.z = groundZ + pVehicle->GetDistanceFromCentreOfMassToBaseOfModel();
pVehicle->GetPosition() = spawnPos; pVehicle->SetPosition(spawnPos);
pVehicle->SetMoveSpeed(CVector(0.0f, 0.0f, 0.0f)); pVehicle->SetMoveSpeed(CVector(0.0f, 0.0f, 0.0f));
pVehicle->SetStatus(STATUS_PHYSICS); pVehicle->SetStatus(STATUS_PHYSICS);
switch (mi){ switch (mi){

View File

@ -1448,14 +1448,14 @@ void CGarage::UpdateDoorsHeight()
{ {
RefreshDoorPointers(false); RefreshDoorPointers(false);
if (m_pDoor1) { if (m_pDoor1) {
m_pDoor1->GetPosition().z = m_fDoorPos + m_fDoor1Z; m_pDoor1->GetMatrix().GetPosition().z = m_fDoorPos + m_fDoor1Z;
if (m_bRotatedDoor) if (m_bRotatedDoor)
BuildRotatedDoorMatrix(m_pDoor1, m_fDoorPos / m_fDoorHeight); BuildRotatedDoorMatrix(m_pDoor1, m_fDoorPos / m_fDoorHeight);
m_pDoor1->GetMatrix().UpdateRW(); m_pDoor1->GetMatrix().UpdateRW();
m_pDoor1->UpdateRwFrame(); m_pDoor1->UpdateRwFrame();
} }
if (m_pDoor2) { if (m_pDoor2) {
m_pDoor2->GetPosition().z = m_fDoorPos + m_fDoor2Z; m_pDoor2->GetMatrix().GetPosition().z = m_fDoorPos + m_fDoor2Z;
if (m_bRotatedDoor) if (m_bRotatedDoor)
BuildRotatedDoorMatrix(m_pDoor2, m_fDoorPos / m_fDoorHeight); BuildRotatedDoorMatrix(m_pDoor2, m_fDoorPos / m_fDoorHeight);
m_pDoor2->GetMatrix().UpdateRW(); m_pDoor2->GetMatrix().UpdateRW();
@ -1482,18 +1482,18 @@ void CGarage::UpdateCrusherAngle()
void CGarage::UpdateCrusherShake(float X, float Y) void CGarage::UpdateCrusherShake(float X, float Y)
{ {
RefreshDoorPointers(false); RefreshDoorPointers(false);
m_pDoor1->GetPosition().x += X; m_pDoor1->GetMatrix().GetPosition().x += X;
m_pDoor1->GetPosition().y += Y; m_pDoor1->GetMatrix().GetPosition().y += Y;
m_pDoor1->GetMatrix().UpdateRW(); m_pDoor1->GetMatrix().UpdateRW();
m_pDoor1->UpdateRwFrame(); m_pDoor1->UpdateRwFrame();
m_pDoor1->GetPosition().x -= X; m_pDoor1->GetMatrix().GetPosition().x -= X;
m_pDoor1->GetPosition().y -= Y; m_pDoor1->GetMatrix().GetPosition().y -= Y;
m_pDoor2->GetPosition().x += X; m_pDoor2->GetMatrix().GetPosition().x += X;
m_pDoor2->GetPosition().y += Y; m_pDoor2->GetMatrix().GetPosition().y += Y;
m_pDoor2->GetMatrix().UpdateRW(); m_pDoor2->GetMatrix().UpdateRW();
m_pDoor2->UpdateRwFrame(); m_pDoor2->UpdateRwFrame();
m_pDoor2->GetPosition().x -= X; m_pDoor2->GetMatrix().GetPosition().x -= X;
m_pDoor2->GetPosition().y -= Y; m_pDoor2->GetMatrix().GetPosition().y -= Y;
} }
// This is dumb but there is no way to avoid goto. What was there originally even? // This is dumb but there is no way to avoid goto. What was there originally even?
@ -1854,7 +1854,7 @@ CVehicle* CStoredCar::RestoreCar()
#else #else
CVehicle* pVehicle = new CAutomobile(m_nModelIndex, RANDOM_VEHICLE); CVehicle* pVehicle = new CAutomobile(m_nModelIndex, RANDOM_VEHICLE);
#endif #endif
pVehicle->GetPosition() = m_vecPos; pVehicle->SetPosition(m_vecPos);
pVehicle->SetStatus(STATUS_ABANDONED); pVehicle->SetStatus(STATUS_ABANDONED);
pVehicle->GetForward() = m_vecAngle; pVehicle->GetForward() = m_vecAngle;
pVehicle->GetRight() = CVector(m_vecAngle.y, -m_vecAngle.x, 0.0f); pVehicle->GetRight() = CVector(m_vecAngle.y, -m_vecAngle.x, 0.0f);
@ -2089,15 +2089,15 @@ void CGarage::CenterCarInGarage(CVehicle* pVehicle)
float offsetZ = pos.z - pos.z; float offsetZ = pos.z - pos.z;
float distance = CVector(offsetX, offsetY, offsetZ).Magnitude(); float distance = CVector(offsetX, offsetY, offsetZ).Magnitude();
if (distance < RESPRAY_CENTERING_COEFFICIENT) { if (distance < RESPRAY_CENTERING_COEFFICIENT) {
pVehicle->GetPosition().x = GetGarageCenterX(); pVehicle->GetMatrix().GetPosition().x = GetGarageCenterX();
pVehicle->GetPosition().y = GetGarageCenterY(); pVehicle->GetMatrix().GetPosition().y = GetGarageCenterY();
} }
else { else {
pVehicle->GetPosition().x += offsetX * RESPRAY_CENTERING_COEFFICIENT / distance; pVehicle->GetMatrix().GetPosition().x += offsetX * RESPRAY_CENTERING_COEFFICIENT / distance;
pVehicle->GetPosition().y += offsetY * RESPRAY_CENTERING_COEFFICIENT / distance; pVehicle->GetMatrix().GetPosition().y += offsetY * RESPRAY_CENTERING_COEFFICIENT / distance;
} }
if (!IsEntityEntirelyInside3D(pVehicle, 0.1f)) if (!IsEntityEntirelyInside3D(pVehicle, 0.1f))
pVehicle->GetPosition() = pos; pVehicle->SetPosition(pos);
} }
void CGarages::CloseHideOutGaragesBeforeSave() void CGarages::CloseHideOutGaragesBeforeSave()
@ -2164,7 +2164,7 @@ int32 CGarages::FindMaxNumStoredCarsForGarage(eGarageType type)
return 0; return 0;
} }
bool CGarages::IsPointWithinHideOutGarage(CVector& point) bool CGarages::IsPointWithinHideOutGarage(Const CVector& point)
{ {
for (int i = 0; i < NUM_GARAGES; i++) { for (int i = 0; i < NUM_GARAGES; i++) {
switch (aGarages[i].m_eGarageType) { switch (aGarages[i].m_eGarageType) {
@ -2180,7 +2180,7 @@ bool CGarages::IsPointWithinHideOutGarage(CVector& point)
return false; return false;
} }
bool CGarages::IsPointWithinAnyGarage(CVector& point) bool CGarages::IsPointWithinAnyGarage(Const CVector& point)
{ {
for (int i = 0; i < NUM_GARAGES; i++) { for (int i = 0; i < NUM_GARAGES; i++) {
switch (aGarages[i].m_eGarageType) { switch (aGarages[i].m_eGarageType) {
@ -2205,7 +2205,7 @@ void CGarages::SetAllDoorsBackToOriginalHeight()
default: default:
aGarages[i].RefreshDoorPointers(true); aGarages[i].RefreshDoorPointers(true);
if (aGarages[i].m_pDoor1) { if (aGarages[i].m_pDoor1) {
aGarages[i].m_pDoor1->GetPosition().z = aGarages[i].m_fDoor1Z; aGarages[i].m_pDoor1->GetMatrix().GetPosition().z = aGarages[i].m_fDoor1Z;
if (aGarages[i].m_pDoor1->IsObject()) if (aGarages[i].m_pDoor1->IsObject())
((CObject*)aGarages[i].m_pDoor1)->m_objectMatrix.GetPosition().z = aGarages[i].m_fDoor1Z; ((CObject*)aGarages[i].m_pDoor1)->m_objectMatrix.GetPosition().z = aGarages[i].m_fDoor1Z;
if (aGarages[i].m_bRotatedDoor) if (aGarages[i].m_bRotatedDoor)
@ -2214,7 +2214,7 @@ void CGarages::SetAllDoorsBackToOriginalHeight()
aGarages[i].m_pDoor1->UpdateRwFrame(); aGarages[i].m_pDoor1->UpdateRwFrame();
} }
if (aGarages[i].m_pDoor2) { if (aGarages[i].m_pDoor2) {
aGarages[i].m_pDoor2->GetPosition().z = aGarages[i].m_fDoor2Z; aGarages[i].m_pDoor2->GetMatrix().GetPosition().z = aGarages[i].m_fDoor2Z;
if (aGarages[i].m_pDoor2->IsObject()) if (aGarages[i].m_pDoor2->IsObject())
((CObject*)aGarages[i].m_pDoor2)->m_objectMatrix.GetPosition().z = aGarages[i].m_fDoor2Z; ((CObject*)aGarages[i].m_pDoor2)->m_objectMatrix.GetPosition().z = aGarages[i].m_fDoor2Z;
if (aGarages[i].m_bRotatedDoor) if (aGarages[i].m_bRotatedDoor)

View File

@ -232,8 +232,8 @@ public:
static bool CameraShouldBeOutside(void); static bool CameraShouldBeOutside(void);
static void GivePlayerDetonator(void); static void GivePlayerDetonator(void);
static void PlayerArrestedOrDied(void); static void PlayerArrestedOrDied(void);
static bool IsPointWithinHideOutGarage(CVector&); static bool IsPointWithinHideOutGarage(Const CVector&);
static bool IsPointWithinAnyGarage(CVector&); static bool IsPointWithinAnyGarage(Const CVector&);
static void SetAllDoorsBackToOriginalHeight(void); static void SetAllDoorsBackToOriginalHeight(void);
static void Save(uint8* buf, uint32* size); static void Save(uint8* buf, uint32* size);
static void Load(uint8* buf, uint32 size); static void Load(uint8* buf, uint32 size);

View File

@ -301,7 +301,7 @@ CPhoneInfo::Initialise(void)
if (building->m_modelIndex == MI_PHONEBOOTH1) { if (building->m_modelIndex == MI_PHONEBOOTH1) {
CPhone *maxPhone = &m_aPhones[m_nMax]; CPhone *maxPhone = &m_aPhones[m_nMax];
maxPhone->m_nState = PHONE_STATE_FREE; maxPhone->m_nState = PHONE_STATE_FREE;
maxPhone->m_vecPos = *(building->GetPosition()); maxPhone->m_vecPos = building->GetPosition();
maxPhone->m_pEntity = building; maxPhone->m_pEntity = building;
m_nMax++; m_nMax++;
} }

View File

@ -84,7 +84,7 @@ CPickup::GiveUsAPickUpObject(int32 handle)
if (object == nil) return nil; if (object == nil) return nil;
object->ObjectCreatedBy = MISSION_OBJECT; object->ObjectCreatedBy = MISSION_OBJECT;
object->GetPosition() = m_vecPos; object->SetPosition(m_vecPos);
object->SetOrientation(0.0f, 0.0f, -HALFPI); object->SetOrientation(0.0f, 0.0f, -HALFPI);
object->GetMatrix().UpdateRW(); object->GetMatrix().UpdateRW();
object->UpdateRwFrame(); object->UpdateRwFrame();
@ -288,7 +288,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
case PICKUP_NAUTICAL_MINE_INACTIVE: case PICKUP_NAUTICAL_MINE_INACTIVE:
{ {
if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, false)) if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, false))
m_pObject->GetPosition().z = waterLevel + 0.6f; m_pObject->GetMatrix().GetPosition().z = waterLevel + 0.6f;
m_pObject->GetMatrix().UpdateRW(); m_pObject->GetMatrix().UpdateRW();
m_pObject->UpdateRwFrame(); m_pObject->UpdateRwFrame();
@ -310,7 +310,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
} }
case PICKUP_NAUTICAL_MINE_ARMED: case PICKUP_NAUTICAL_MINE_ARMED:
if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, false)) if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, false))
m_pObject->GetPosition().z = waterLevel + 0.6f; m_pObject->GetMatrix().GetPosition().z = waterLevel + 0.6f;
m_pObject->GetMatrix().UpdateRW(); m_pObject->GetMatrix().UpdateRW();
m_pObject->UpdateRwFrame(); m_pObject->UpdateRwFrame();
@ -337,7 +337,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
} }
case PICKUP_FLOATINGPACKAGE: case PICKUP_FLOATINGPACKAGE:
m_pObject->m_vecMoveSpeed.z -= 0.01f * CTimer::GetTimeStep(); m_pObject->m_vecMoveSpeed.z -= 0.01f * CTimer::GetTimeStep();
m_pObject->GetPosition() += m_pObject->GetMoveSpeed() * CTimer::GetTimeStep(); m_pObject->GetMatrix().GetPosition() += m_pObject->GetMoveSpeed() * CTimer::GetTimeStep();
m_pObject->GetMatrix().UpdateRW(); m_pObject->GetMatrix().UpdateRW();
m_pObject->UpdateRwFrame(); m_pObject->UpdateRwFrame();
@ -346,7 +346,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
break; break;
case PICKUP_FLOATINGPACKAGE_FLOATING: 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, 0))
m_pObject->GetPosition().z = waterLevel; m_pObject->GetMatrix().GetPosition().z = waterLevel;
m_pObject->GetMatrix().UpdateRW(); m_pObject->GetMatrix().UpdateRW();
m_pObject->UpdateRwFrame(); m_pObject->UpdateRwFrame();
@ -695,7 +695,7 @@ CPickups::DoPickUpEffects(CEntity *entity)
assert(colorId >= 0); assert(colorId >= 0);
CVector &pos = entity->GetPosition(); const CVector &pos = entity->GetPosition();
float colorModifier = ((CGeneral::GetRandomNumber() & 0x1F) * 0.015f + 1.0f) * modifiedSin * 0.15f; float colorModifier = ((CGeneral::GetRandomNumber() & 0x1F) * 0.015f + 1.0f) * modifiedSin * 0.15f;
CShadows::StoreStaticShadow( CShadows::StoreStaticShadow(
@ -749,7 +749,7 @@ CPickups::DoPickUpEffects(CEntity *entity)
void void
CPickups::DoMineEffects(CEntity *entity) CPickups::DoMineEffects(CEntity *entity)
{ {
CVector &pos = entity->GetPosition(); const CVector &pos = entity->GetPosition();
float dist = (TheCamera.GetPosition() - pos).Magnitude(); float dist = (TheCamera.GetPosition() - pos).Magnitude();
const float MAXDIST = 20.0f; const float MAXDIST = 20.0f;
@ -771,7 +771,7 @@ CPickups::DoMineEffects(CEntity *entity)
void void
CPickups::DoMoneyEffects(CEntity *entity) CPickups::DoMoneyEffects(CEntity *entity)
{ {
CVector &pos = entity->GetPosition(); const CVector &pos = entity->GetPosition();
float dist = (TheCamera.GetPosition() - pos).Magnitude(); float dist = (TheCamera.GetPosition() - pos).Magnitude();
const float MAXDIST = 20.0f; const float MAXDIST = 20.0f;
@ -793,7 +793,7 @@ CPickups::DoMoneyEffects(CEntity *entity)
void void
CPickups::DoCollectableEffects(CEntity *entity) CPickups::DoCollectableEffects(CEntity *entity)
{ {
CVector &pos = entity->GetPosition(); const CVector &pos = entity->GetPosition();
float dist = (TheCamera.GetPosition() - pos).Magnitude(); float dist = (TheCamera.GetPosition() - pos).Magnitude();
const float MAXDIST = 14.0f; const float MAXDIST = 14.0f;
@ -1145,7 +1145,7 @@ CPacManPickups::GeneratePMPickUps(CVector pos, float scrambleMult, int16 count,
CObject *obj = new CObject(MI_BULLION, true); CObject *obj = new CObject(MI_BULLION, true);
if (obj != nil) { if (obj != nil) {
obj->ObjectCreatedBy = MISSION_OBJECT; obj->ObjectCreatedBy = MISSION_OBJECT;
obj->GetPosition() = aPMPickUps[i].m_vecPosn; obj->SetPosition(aPMPickUps[i].m_vecPosn);
obj->SetOrientation(0.0f, 0.0f, -HALFPI); obj->SetOrientation(0.0f, 0.0f, -HALFPI);
obj->GetMatrix().UpdateRW(); obj->GetMatrix().UpdateRW();
obj->UpdateRwFrame(); obj->UpdateRwFrame();
@ -1296,7 +1296,7 @@ CPacManPickups::GeneratePMPickUpsForRace(int32 race)
if (obj != nil) { if (obj != nil) {
obj->ObjectCreatedBy = MISSION_OBJECT; obj->ObjectCreatedBy = MISSION_OBJECT;
obj->GetPosition() = aPMPickUps[i].m_vecPosn; obj->SetPosition(aPMPickUps[i].m_vecPosn);
obj->SetOrientation(0.0f, 0.0f, -HALFPI); obj->SetOrientation(0.0f, 0.0f, -HALFPI);
obj->GetMatrix().UpdateRW(); obj->GetMatrix().UpdateRW();
obj->UpdateRwFrame(); obj->UpdateRwFrame();

View File

@ -279,7 +279,7 @@ void CRecordDataForChase::SaveOrRetrieveCarPositions(void)
} }
if (CPad::GetPad(0)->GetLeftShockJustDown() && CPad::GetPad(0)->GetRightShockJustDown()) { if (CPad::GetPad(0)->GetLeftShockJustDown() && CPad::GetPad(0)->GetRightShockJustDown()) {
if (!CPad::GetPad(0)->GetRightShockJustDown()) { if (!CPad::GetPad(0)->GetRightShockJustDown()) {
pChaseCars[CurrentCar]->GetPosition() = NewCoorsForRecordedCars[PositionChanges].pos; pChaseCars[CurrentCar]->SetPosition(NewCoorsForRecordedCars[PositionChanges].pos);
pChaseCars[CurrentCar]->SetMoveSpeed(0.0f, 0.0f, 0.0f); pChaseCars[CurrentCar]->SetMoveSpeed(0.0f, 0.0f, 0.0f);
pChaseCars[CurrentCar]->GetMatrix().SetRotateZOnly(DEGTORAD(NewCoorsForRecordedCars[PositionChanges].angle)); pChaseCars[CurrentCar]->GetMatrix().SetRotateZOnly(DEGTORAD(NewCoorsForRecordedCars[PositionChanges].angle));
++PositionChanges; ++PositionChanges;
@ -311,12 +311,12 @@ void CRecordDataForChase::SaveOrRetrieveCarPositions(void)
pChaseCars[i]->GetRight() += (tmp.GetRight() - pChaseCars[i]->GetRight()) * dp; pChaseCars[i]->GetRight() += (tmp.GetRight() - pChaseCars[i]->GetRight()) * dp;
pChaseCars[i]->GetForward() += (tmp.GetForward() - pChaseCars[i]->GetForward()) * dp; pChaseCars[i]->GetForward() += (tmp.GetForward() - pChaseCars[i]->GetForward()) * dp;
pChaseCars[i]->GetUp() += (tmp.GetUp() - pChaseCars[i]->GetUp()) * dp; pChaseCars[i]->GetUp() += (tmp.GetUp() - pChaseCars[i]->GetUp()) * dp;
pChaseCars[i]->GetPosition() += (tmp.GetPosition() - pChaseCars[i]->GetPosition()) * dp; pChaseCars[i]->GetMatrix().GetPosition() += (tmp.GetPosition() - pChaseCars[i]->GetPosition()) * dp;
} }
else{ else{
RestoreInfoForCar(pChaseCars[i], &pBaseMemForCar[i][CHASE_SCENE_FRAMES_IN_RECORDING - 1], true); RestoreInfoForCar(pChaseCars[i], &pBaseMemForCar[i][CHASE_SCENE_FRAMES_IN_RECORDING - 1], true);
if (i == 0) if (i == 0)
pChaseCars[i]->GetPosition().z += 0.2f; pChaseCars[i]->GetMatrix().GetPosition().z += 0.2f;
} }
pChaseCars[i]->GetMatrix().UpdateRW(); pChaseCars[i]->GetMatrix().UpdateRW();
pChaseCars[i]->UpdateRwFrame(); pChaseCars[i]->UpdateRwFrame();
@ -407,7 +407,7 @@ void CRecordDataForChase::GiveUsACar(int32 mi, CVector pos, float angle, CAutomo
if (!CStreaming::HasModelLoaded(mi)) if (!CStreaming::HasModelLoaded(mi))
return; return;
CAutomobile* pCar = new CAutomobile(mi, MISSION_VEHICLE); CAutomobile* pCar = new CAutomobile(mi, MISSION_VEHICLE);
pCar->GetPosition() = pos; pCar->SetPosition(pos);
pCar->SetStatus(STATUS_PLAYER_PLAYBACKFROMBUFFER); pCar->SetStatus(STATUS_PLAYER_PLAYBACKFROMBUFFER);
pCar->GetMatrix().SetRotateZOnly(DEGTORAD(angle)); pCar->GetMatrix().SetRotateZOnly(DEGTORAD(angle));
pCar->pDriver = nil; pCar->pDriver = nil;

View File

@ -18,7 +18,7 @@ CRemote::GivePlayerRemoteControlledCar(float x, float y, float z, float rot, uin
z = car->GetDistanceFromCentreOfMassToBaseOfModel() + CWorld::FindGroundZFor3DCoord(x, y, z + 2.0f, &found); z = car->GetDistanceFromCentreOfMassToBaseOfModel() + CWorld::FindGroundZFor3DCoord(x, y, z + 2.0f, &found);
car->GetMatrix().SetRotateZOnly(rot); car->GetMatrix().SetRotateZOnly(rot);
car->GetPosition() = CVector(x, y, z); car->SetPosition(x, y, z);
car->SetStatus(STATUS_PLAYER_REMOTE); car->SetStatus(STATUS_PLAYER_REMOTE);
car->bIsLocked = true; car->bIsLocked = true;

View File

@ -1020,7 +1020,7 @@ void CReplay::ProcessReplayCamera(void)
switch (CameraMode) { switch (CameraMode) {
case REPLAYCAMMODE_TOPDOWN: case REPLAYCAMMODE_TOPDOWN:
{ {
TheCamera.GetPosition() = CVector(CameraFocusX, CameraFocusY, CameraFocusZ + 15.0f); TheCamera.SetPosition(CameraFocusX, CameraFocusY, CameraFocusZ + 15.0f);
TheCamera.GetForward() = CVector(0.0f, 0.0f, -1.0f); TheCamera.GetForward() = CVector(0.0f, 0.0f, -1.0f);
TheCamera.GetUp() = CVector(0.0f, 1.0f, 0.0f); TheCamera.GetUp() = CVector(0.0f, 1.0f, 0.0f);
TheCamera.GetRight() = CVector(1.0f, 0.0f, 0.0f); TheCamera.GetRight() = CVector(1.0f, 0.0f, 0.0f);
@ -1539,7 +1539,7 @@ void CReplay::ProcessLookAroundCam(void)
TheCamera.GetForward() = forward; TheCamera.GetForward() = forward;
TheCamera.GetUp() = up; TheCamera.GetUp() = up;
TheCamera.GetRight() = right; TheCamera.GetRight() = right;
TheCamera.GetPosition() = camera_pt; TheCamera.SetPosition(camera_pt);
RwMatrix* pm = RwFrameGetMatrix(RwCameraGetFrame(TheCamera.m_pRwCamera)); RwMatrix* pm = RwFrameGetMatrix(RwCameraGetFrame(TheCamera.m_pRwCamera));
pm->pos = *(RwV3d*)&TheCamera.GetPosition(); pm->pos = *(RwV3d*)&TheCamera.GetPosition();
pm->at = *(RwV3d*)&TheCamera.GetForward(); pm->at = *(RwV3d*)&TheCamera.GetForward();

View File

@ -349,7 +349,7 @@ void CSceneEdit::ProcessCommand(void)
} }
CPed* pPed = new CCivilianPed(PEDTYPE_SPECIAL, m_nPedmodelId); CPed* pPed = new CCivilianPed(PEDTYPE_SPECIAL, m_nPedmodelId);
pPed->CharCreatedBy = MISSION_CHAR; pPed->CharCreatedBy = MISSION_CHAR;
pPed->GetPosition() = m_vecCurrentPosition; pPed->SetPosition(m_vecCurrentPosition);
pPed->SetOrientation(0.0f, 0.0f, 0.0f); pPed->SetOrientation(0.0f, 0.0f, 0.0f);
CWorld::Add(pPed); CWorld::Add(pPed);
pPed->bUsesCollision = false; pPed->bUsesCollision = false;
@ -363,7 +363,7 @@ void CSceneEdit::ProcessCommand(void)
} }
} }
else { else {
pActors[m_nActor]->GetPosition() = m_vecCurrentPosition; pActors[m_nActor]->SetPosition(m_vecCurrentPosition);
pActors[m_nActor]->SetOrientation(0.0f, 0.0f, 0.0f); pActors[m_nActor]->SetOrientation(0.0f, 0.0f, 0.0f);
int32 mi = m_nPedmodelId; int32 mi = m_nPedmodelId;
if (CPad::GetPad(1)->GetLeftShoulder1JustDown()) if (CPad::GetPad(1)->GetLeftShoulder1JustDown())
@ -405,7 +405,7 @@ void CSceneEdit::ProcessCommand(void)
SelectActor(); SelectActor();
if (m_bCommandActive) if (m_bCommandActive)
break; break;
pActors[m_nActor]->GetPosition() = m_vecCurrentPosition; pActors[m_nActor]->SetPosition(m_vecCurrentPosition);
if (CPad::GetPad(1)->GetTriangleJustDown()) { if (CPad::GetPad(1)->GetTriangleJustDown()) {
m_bCommandActive = false; m_bCommandActive = false;
#ifndef FIX_BUGS // why? it crashes, also makes no sense #ifndef FIX_BUGS // why? it crashes, also makes no sense
@ -451,7 +451,7 @@ void CSceneEdit::ProcessCommand(void)
} }
CVehicle* pVehicle = new CAutomobile(m_nVehiclemodelId, MISSION_VEHICLE); CVehicle* pVehicle = new CAutomobile(m_nVehiclemodelId, MISSION_VEHICLE);
pVehicle->SetStatus(STATUS_PHYSICS); pVehicle->SetStatus(STATUS_PHYSICS);
pVehicle->GetPosition() = m_vecCurrentPosition; pVehicle->SetPosition(m_vecCurrentPosition);
pVehicle->SetOrientation(0.0f, 0.0f, 0.0f); pVehicle->SetOrientation(0.0f, 0.0f, 0.0f);
CWorld::Add(pVehicle); CWorld::Add(pVehicle);
pVehicle->bUsesCollision = false; pVehicle->bUsesCollision = false;
@ -465,7 +465,7 @@ void CSceneEdit::ProcessCommand(void)
} }
} }
else { else {
pVehicles[m_nVehicle]->GetPosition() = m_vecCurrentPosition; pVehicles[m_nVehicle]->SetPosition(m_vecCurrentPosition);
pVehicles[m_nVehicle]->SetOrientation(0.0f, 0.0f, 0.0f); pVehicles[m_nVehicle]->SetOrientation(0.0f, 0.0f, 0.0f);
int32 mi = m_nVehiclemodelId; int32 mi = m_nVehiclemodelId;
if (CPad::GetPad(1)->GetLeftShoulder1JustDown()) if (CPad::GetPad(1)->GetLeftShoulder1JustDown())
@ -507,7 +507,7 @@ void CSceneEdit::ProcessCommand(void)
SelectVehicle(); SelectVehicle();
if (m_bCommandActive) if (m_bCommandActive)
break; break;
pVehicles[m_nVehicle]->GetPosition() = m_vecCurrentPosition; pVehicles[m_nVehicle]->SetPosition(m_vecCurrentPosition);
if (CPad::GetPad(1)->GetTriangleJustDown()) { if (CPad::GetPad(1)->GetTriangleJustDown()) {
m_bCommandActive = false; m_bCommandActive = false;
#ifndef FIX_BUGS // again, why? works wrong #ifndef FIX_BUGS // again, why? works wrong
@ -785,7 +785,7 @@ void CSceneEdit::PlayBack(void)
CPed* pPed = new CCivilianPed(PEDTYPE_SPECIAL, m_nPedmodelId); CPed* pPed = new CCivilianPed(PEDTYPE_SPECIAL, m_nPedmodelId);
pPed->CharCreatedBy = MISSION_CHAR; pPed->CharCreatedBy = MISSION_CHAR;
CWorld::Add(pPed); CWorld::Add(pPed);
pPed->GetPosition() = m_vecCurrentPosition; pPed->SetPosition(m_vecCurrentPosition);
pPed->SetOrientation(0.0f, 0.0f, 0.0f); pPed->SetOrientation(0.0f, 0.0f, 0.0f);
for (int i = 0; i < NUM_ACTORS_IN_MOVIE; i++) { for (int i = 0; i < NUM_ACTORS_IN_MOVIE; i++) {
if (pActors[i] == nil) { if (pActors[i] == nil) {
@ -811,7 +811,7 @@ void CSceneEdit::PlayBack(void)
} }
CVehicle* pVehicle = new CAutomobile(m_nVehiclemodelId, MISSION_VEHICLE); CVehicle* pVehicle = new CAutomobile(m_nVehiclemodelId, MISSION_VEHICLE);
pVehicle->SetStatus(STATUS_PHYSICS); pVehicle->SetStatus(STATUS_PHYSICS);
pVehicle->GetPosition() = m_vecCurrentPosition; pVehicle->SetPosition(m_vecCurrentPosition);
pVehicle->SetOrientation(0.0f, 0.0f, 0.0f); pVehicle->SetOrientation(0.0f, 0.0f, 0.0f);
CWorld::Add(pVehicle); CWorld::Add(pVehicle);
for (int i = 0; i < NUM_VEHICLES_IN_MOVIE; i++) { for (int i = 0; i < NUM_VEHICLES_IN_MOVIE; i++) {

View File

@ -1293,7 +1293,7 @@ int8 CRunningScript::ProcessCommands0To99(int32 command)
if (pos.z <= MAP_Z_LOW_LIMIT) if (pos.z <= MAP_Z_LOW_LIMIT)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y); pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
pos.z += CWorld::Players[index].m_pPed->GetDistanceFromCentreOfMassToBaseOfModel(); pos.z += CWorld::Players[index].m_pPed->GetDistanceFromCentreOfMassToBaseOfModel();
CWorld::Players[index].m_pPed->GetPosition() = pos; CWorld::Players[index].m_pPed->SetPosition(pos);
CTheScripts::ClearSpaceForMissionEntity(pos, CWorld::Players[index].m_pPed); CTheScripts::ClearSpaceForMissionEntity(pos, CWorld::Players[index].m_pPed);
CPlayerPed::ReactivatePlayerPed(index); CPlayerPed::ReactivatePlayerPed(index);
ScriptParams[0] = index; ScriptParams[0] = index;
@ -5153,7 +5153,7 @@ int8 CRunningScript::ProcessCommands500To599(int32 command)
if (pos.z <= MAP_Z_LOW_LIMIT) if (pos.z <= MAP_Z_LOW_LIMIT)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y); pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
CRestart::OverrideNextRestart(pos, *(float*)&ScriptParams[3]); CRestart::OverrideNextRestart(pos, *(float*)&ScriptParams[3]);
if (CWorld::Players[CWorld::PlayerInFocus].m_WBState != WBSTATE_PLAYING) //TODO: enum if (CWorld::Players[CWorld::PlayerInFocus].m_WBState != WBSTATE_PLAYING)
printf("RESTART_CRITICAL_MISSION - Player state is not PLAYING\n"); printf("RESTART_CRITICAL_MISSION - Player state is not PLAYING\n");
CWorld::Players[CWorld::PlayerInFocus].PlayerFailedCriticalMission(); CWorld::Players[CWorld::PlayerInFocus].PlayerFailedCriticalMission();
return 0; return 0;

View File

@ -3794,7 +3794,7 @@ CCam::Process_Debug(const CVector&, float, float, float)
if(FindPlayerVehicle()) if(FindPlayerVehicle())
FindPlayerVehicle()->Teleport(Source); FindPlayerVehicle()->Teleport(Source);
else else
CWorld::Players[CWorld::PlayerInFocus].m_pPed->GetPosition() = Source; CWorld::Players[CWorld::PlayerInFocus].m_pPed->SetPosition(Source);
} }
// stay inside sectors // stay inside sectors
@ -3941,7 +3941,7 @@ CCam::Process_Editor(const CVector&, float, float, float)
if(FindPlayerVehicle()) if(FindPlayerVehicle())
FindPlayerVehicle()->Teleport(Source); FindPlayerVehicle()->Teleport(Source);
else else
CWorld::Players[CWorld::PlayerInFocus].m_pPed->GetPosition() = Source; CWorld::Players[CWorld::PlayerInFocus].m_pPed->SetPosition(Source);
} }

View File

@ -104,7 +104,7 @@ void TankCheat()
if (tank != nil) { if (tank != nil) {
CVector pos = ThePaths.m_pathNodes[node].pos; CVector pos = ThePaths.m_pathNodes[node].pos;
pos.z += 4.0f; pos.z += 4.0f;
tank->GetPosition() = pos; tank->SetPosition(pos);
tank->SetOrientation(0.0f, 0.0f, DEGTORAD(200.0f)); tank->SetOrientation(0.0f, 0.0f, DEGTORAD(200.0f));
tank->SetStatus(STATUS_ABANDONED); tank->SetStatus(STATUS_ABANDONED);

View File

@ -418,6 +418,7 @@ public:
bool GetLeftStickYJustDown() { return !!(NewState.LeftStickY && !OldState.LeftStickY); } bool GetLeftStickYJustDown() { return !!(NewState.LeftStickY && !OldState.LeftStickY); }
bool GetTriangleJustUp() { return !!(!NewState.Triangle && OldState.Triangle); } bool GetTriangleJustUp() { return !!(!NewState.Triangle && OldState.Triangle); }
bool GetCircleJustUp() { return !!(!NewState.Circle && OldState.Circle); }
bool GetCrossJustUp() { return !!(!NewState.Cross && OldState.Cross); } bool GetCrossJustUp() { return !!(!NewState.Cross && OldState.Cross); }
bool GetSquareJustUp() { return !!(!NewState.Square && OldState.Square); } bool GetSquareJustUp() { return !!(!NewState.Square && OldState.Square); }
bool GetDPadUpJustUp() { return !!(!NewState.DPadUp && OldState.DPadUp); } bool GetDPadUpJustUp() { return !!(!NewState.DPadUp && OldState.DPadUp); }

View File

@ -11,6 +11,12 @@ public:
CPlaceable(void); CPlaceable(void);
virtual ~CPlaceable(void); virtual ~CPlaceable(void);
CVector &GetPosition(void) { return m_matrix.GetPosition(); } CVector &GetPosition(void) { return m_matrix.GetPosition(); }
void SetPosition(float x, float y, float z) {
m_matrix.GetPosition().x = x;
m_matrix.GetPosition().y = y;
m_matrix.GetPosition().z = z;
}
void SetPosition(const CVector &pos) { m_matrix.GetPosition() = pos; }
CVector &GetRight(void) { return m_matrix.GetRight(); } CVector &GetRight(void) { return m_matrix.GetRight(); }
CVector &GetForward(void) { return m_matrix.GetForward(); } CVector &GetForward(void) { return m_matrix.GetForward(); }
CVector &GetUp(void) { return m_matrix.GetUp(); } CVector &GetUp(void) { return m_matrix.GetUp(); }

View File

@ -524,7 +524,7 @@ void CRadar::DrawBlips()
} else { } else {
#ifdef TRIANGULAR_BLIPS #ifdef TRIANGULAR_BLIPS
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift(); CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
CVector &blipPos = blipEntity->GetPosition(); const CVector &blipPos = blipEntity->GetPosition();
uint8 mode = BLIP_MODE_TRIANGULAR_UP; uint8 mode = BLIP_MODE_TRIANGULAR_UP;
if (blipPos.z - pos.z <= 2.0f) { if (blipPos.z - pos.z <= 2.0f) {
if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN; if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
@ -630,7 +630,7 @@ void CRadar::DrawBlips()
#ifdef TRIANGULAR_BLIPS #ifdef TRIANGULAR_BLIPS
{ {
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift(); CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
CVector &blipPos = blipEntity->GetPosition(); const CVector &blipPos = blipEntity->GetPosition();
uint8 mode = BLIP_MODE_TRIANGULAR_UP; uint8 mode = BLIP_MODE_TRIANGULAR_UP;
if (blipPos.z - pos.z <= 2.0f) { if (blipPos.z - pos.z <= 2.0f) {
if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN; if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;

View File

@ -659,7 +659,7 @@ CWorld::GetIsLineOfSightSectorListClear(CPtrList &list, const CColLine &line, bo
} }
void void
CWorld::FindObjectsInRangeSectorList(CPtrList &list, CVector &centre, float radius, bool ignoreZ, short *nextObject, CWorld::FindObjectsInRangeSectorList(CPtrList &list, Const CVector &centre, float radius, bool ignoreZ, short *nextObject,
short lastObject, CEntity **objects) short lastObject, CEntity **objects)
{ {
float radiusSqr = radius * radius; float radiusSqr = radius * radius;
@ -685,7 +685,7 @@ CWorld::FindObjectsInRangeSectorList(CPtrList &list, CVector &centre, float radi
} }
void void
CWorld::FindObjectsInRange(CVector &centre, float radius, bool ignoreZ, short *nextObject, short lastObject, CWorld::FindObjectsInRange(Const CVector &centre, float radius, bool ignoreZ, short *nextObject, short lastObject,
CEntity **objects, bool checkBuildings, bool checkVehicles, bool checkPeds, CEntity **objects, bool checkBuildings, bool checkVehicles, bool checkPeds,
bool checkObjects, bool checkDummies) bool checkObjects, bool checkDummies)
{ {

View File

@ -101,8 +101,8 @@ public:
static CEntity *TestSphereAgainstWorld(CVector centre, float radius, CEntity *entityToIgnore, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSomeObjects); static CEntity *TestSphereAgainstWorld(CVector centre, float radius, CEntity *entityToIgnore, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSomeObjects);
static CEntity *TestSphereAgainstSectorList(CPtrList&, CVector, float, CEntity*, bool); static CEntity *TestSphereAgainstSectorList(CPtrList&, CVector, float, CEntity*, bool);
static void FindObjectsInRangeSectorList(CPtrList&, CVector&, float, bool, short*, short, CEntity**); static void FindObjectsInRangeSectorList(CPtrList&, Const CVector&, float, bool, short*, short, CEntity**);
static void FindObjectsInRange(CVector&, float, bool, short*, short, CEntity**, bool, bool, bool, bool, bool); static void FindObjectsInRange(Const CVector&, float, bool, short*, short, CEntity**, bool, bool, bool, bool, bool);
static void FindObjectsOfTypeInRangeSectorList(uint32 modelId, CPtrList& list, const CVector& position, float radius, bool bCheck2DOnly, int16* nEntitiesFound, int16 maxEntitiesToFind, CEntity** aEntities); static void FindObjectsOfTypeInRangeSectorList(uint32 modelId, CPtrList& list, const CVector& position, float radius, bool bCheck2DOnly, int16* nEntitiesFound, int16 maxEntitiesToFind, CEntity** aEntities);
static void FindObjectsOfTypeInRange(uint32 modelId, const CVector& position, float radius, bool bCheck2DOnly, int16* nEntitiesFound, int16 maxEntitiesToFind, CEntity** aEntities, bool bBuildings, bool bVehicles, bool bPeds, bool bObjects, bool bDummies); static void FindObjectsOfTypeInRange(uint32 modelId, const CVector& position, float radius, bool bCheck2DOnly, int16* nEntitiesFound, int16 maxEntitiesToFind, CEntity** aEntities, bool bBuildings, bool bVehicles, bool bPeds, bool bObjects, bool bDummies);
static float FindGroundZForCoord(float x, float y); static float FindGroundZForCoord(float x, float y);

View File

@ -522,7 +522,7 @@ CCullZone::CalcDistToCullZoneSquared(float x, float y)
bool bool
CCullZone::IsEntityCloseEnoughToZone(CEntity *entity, bool checkLevel) CCullZone::IsEntityCloseEnoughToZone(CEntity *entity, bool checkLevel)
{ {
CVector &pos = entity->GetPosition(); const CVector &pos = entity->GetPosition();
CSimpleModelInfo *minfo = (CSimpleModelInfo*)CModelInfo::GetModelInfo(entity->GetModelIndex()); CSimpleModelInfo *minfo = (CSimpleModelInfo*)CModelInfo::GetModelInfo(entity->GetModelIndex());
float distToZone = CalcDistToCullZone(pos.x, pos.y); float distToZone = CalcDistToCullZone(pos.x, pos.y);

View File

@ -58,6 +58,9 @@
#define Max(a,b) ((a) > (b) ? (a) : (b)) #define Max(a,b) ((a) > (b) ? (a) : (b))
#define Min(a,b) ((a) < (b) ? (a) : (b)) #define Min(a,b) ((a) < (b) ? (a) : (b))
// Use this to add const that wasn't there in the original code
#define Const const
typedef uint8_t uint8; typedef uint8_t uint8;
typedef int8_t int8; typedef int8_t int8;
typedef uint16_t uint16; typedef uint16_t uint16;

View File

@ -116,11 +116,11 @@ SpawnCar(int id)
DebugMenuEntrySetAddress(carCol2, &v->m_currentColour2); DebugMenuEntrySetAddress(carCol2, &v->m_currentColour2);
if(CModelInfo::IsBoatModel(id)) if(CModelInfo::IsBoatModel(id))
v->GetPosition() = TheCamera.GetPosition() + TheCamera.GetForward()*15.0f; v->SetPosition(TheCamera.GetPosition() + TheCamera.GetForward()*15.0f);
else else
v->GetPosition() = ThePaths.m_pathNodes[node].pos; v->SetPosition(ThePaths.m_pathNodes[node].pos);
v->GetPosition().z += 4.0f; v->GetMatrix().GetPosition().z += 4.0f;
v->SetOrientation(0.0f, 0.0f, 3.49f); v->SetOrientation(0.0f, 0.0f, 3.49f);
v->SetStatus(STATUS_ABANDONED); v->SetStatus(STATUS_ABANDONED);
v->m_nDoorLock = CARLOCK_UNLOCKED; v->m_nDoorLock = CARLOCK_UNLOCKED;

View File

@ -137,7 +137,7 @@ CParticleObject::AddObject(uint16 type, CVector const &pos, CVector const &targe
pobj->m_nState = POBJECTSTATE_UPDATE_CLOSE; pobj->m_nState = POBJECTSTATE_UPDATE_CLOSE;
pobj->m_Type = (eParticleObjectType)type; pobj->m_Type = (eParticleObjectType)type;
pobj->GetPosition() = pos; pobj->SetPosition(pos);
pobj->m_vecTarget = target; pobj->m_vecTarget = target;
pobj->m_nNumEffectCycles = 1; pobj->m_nNumEffectCycles = 1;
@ -1174,7 +1174,7 @@ CParticleObject::LoadParticle(uint8 *buffer, uint32 length)
dst->m_nState = POBJECTSTATE_UPDATE_CLOSE; dst->m_nState = POBJECTSTATE_UPDATE_CLOSE;
dst->m_Type = src->m_Type; dst->m_Type = src->m_Type;
dst->m_ParticleType = src->m_ParticleType; dst->m_ParticleType = src->m_ParticleType;
dst->GetPosition() = src->GetPosition(); dst->SetPosition(src->GetPosition());
dst->m_vecTarget = src->m_vecTarget; dst->m_vecTarget = src->m_vecTarget;
dst->m_nFrameCounter = src->m_nFrameCounter; dst->m_nFrameCounter = src->m_nFrameCounter;
dst->m_bRemove = src->m_bRemove; dst->m_bRemove = src->m_bRemove;

View File

@ -2401,7 +2401,7 @@ void
CPed::Teleport(CVector pos) CPed::Teleport(CVector pos)
{ {
CWorld::Remove(this); CWorld::Remove(this);
GetPosition() = pos; SetPosition(pos);
bIsStanding = false; bIsStanding = false;
m_nPedStateTimer = 0; m_nPedStateTimer = 0;
m_actionX = 0.0f; m_actionX = 0.0f;
@ -3222,7 +3222,7 @@ CPed::TurnBody(void)
bool turnDone = true; bool turnDone = true;
if (m_pLookTarget) { if (m_pLookTarget) {
CVector &lookPos = m_pLookTarget->GetPosition(); const CVector &lookPos = m_pLookTarget->GetPosition();
lookDir = CGeneral::GetRadianAngleBetweenPoints( lookDir = CGeneral::GetRadianAngleBetweenPoints(
lookPos.x, lookPos.x,

View File

@ -647,7 +647,7 @@ CGlass::WindowRespondsToCollision(CEntity *entity, float amount, CVector speed,
} }
object->bGlassBroken = true; object->bGlassBroken = true;
object->GetPosition().z = -100.0f; object->GetMatrix().GetPosition().z = -100.0f;
} }
void void

View File

@ -58,7 +58,7 @@ CPointLights::AddLight(uint8 type, CVector coors, CVector dir, float radius, flo
} }
float float
CPointLights::GenerateLightsAffectingObject(CVector *objCoors) CPointLights::GenerateLightsAffectingObject(Const CVector *objCoors)
{ {
int i; int i;
float ret; float ret;

View File

@ -39,7 +39,7 @@ public:
static void InitPerFrame(void); static void InitPerFrame(void);
static void AddLight(uint8 type, CVector coors, CVector dir, float radius, float red, float green, float blue, uint8 fogType, bool castExtraShadows); static void AddLight(uint8 type, CVector coors, CVector dir, float radius, float red, float green, float blue, uint8 fogType, bool castExtraShadows);
static float GenerateLightsAffectingObject(CVector *objCoors); static float GenerateLightsAffectingObject(Const CVector *objCoors);
static void RemoveLightsAffectingObject(void); static void RemoveLightsAffectingObject(void);
static void RenderFogEffect(void); static void RenderFogEffect(void);
}; };

View File

@ -214,7 +214,7 @@ CShadows::AddPermanentShadow(uint8 ShadowType, RwTexture *pTexture, CVector *pPo
} }
void void
CShadows::StoreStaticShadow(uint32 nID, uint8 ShadowType, RwTexture *pTexture, CVector *pPosn, CShadows::StoreStaticShadow(uint32 nID, uint8 ShadowType, RwTexture *pTexture, Const CVector *pPosn,
float fFrontX, float fFrontY, float fSideX, float fSideY, float fFrontX, float fFrontY, float fSideX, float fSideY,
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue, int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
float fZDistance, float fScale, float fDrawDistance, bool bTempShadow, float fUpDistance) float fZDistance, float fScale, float fDrawDistance, bool bTempShadow, float fUpDistance)

View File

@ -143,7 +143,7 @@ public:
static void Init (void); static void Init (void);
static void Shutdown (void); static void Shutdown (void);
static void AddPermanentShadow ( uint8 ShadowType, RwTexture *pTexture, CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue, float fZDistance, uint32 nTime, float fScale); static void AddPermanentShadow ( uint8 ShadowType, RwTexture *pTexture, CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue, float fZDistance, uint32 nTime, float fScale);
static void StoreStaticShadow (uint32 nID, uint8 ShadowType, RwTexture *pTexture, CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue, float fZDistance, float fScale, float fDrawDistance, bool bTempShadow, float fUpDistance); static void StoreStaticShadow (uint32 nID, uint8 ShadowType, RwTexture *pTexture, Const CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue, float fZDistance, float fScale, float fDrawDistance, bool bTempShadow, float fUpDistance);
static void StoreShadowToBeRendered ( uint8 ShadowType, CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue); static void StoreShadowToBeRendered ( uint8 ShadowType, CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue);
static void StoreShadowToBeRendered ( uint8 ShadowType, RwTexture *pTexture, CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue, float fZDistance, bool bDrawOnWater, float fScale); static void StoreShadowToBeRendered ( uint8 ShadowType, RwTexture *pTexture, CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue, float fZDistance, bool bDrawOnWater, float fScale);
static void StoreShadowForCar (CAutomobile *pCar); static void StoreShadowForCar (CAutomobile *pCar);

View File

@ -1220,7 +1220,7 @@ CAutomobile::Teleport(CVector pos)
{ {
CWorld::Remove(this); CWorld::Remove(this);
GetPosition() = pos; SetPosition(pos);
SetOrientation(0.0f, 0.0f, 0.0f); SetOrientation(0.0f, 0.0f, 0.0f);
SetMoveSpeed(0.0f, 0.0f, 0.0f); SetMoveSpeed(0.0f, 0.0f, 0.0f);
SetTurnSpeed(0.0f, 0.0f, 0.0f); SetTurnSpeed(0.0f, 0.0f, 0.0f);

View File

@ -520,7 +520,7 @@ CBoat::ProcessControl(void)
// is this some inlined CPlaceable method? // is this some inlined CPlaceable method?
CVector pos = GetPosition(); CVector pos = GetPosition();
GetMatrix().RotateZ(m_fOrientation - GetForward().Heading()); GetMatrix().RotateZ(m_fOrientation - GetForward().Heading());
GetPosition() = pos; GetMatrix().GetPosition() = pos;
} }
} }
@ -680,7 +680,7 @@ CBoat::BlowUpCar(CEntity *culprit)
dist.Normalise(); dist.Normalise();
if(GetUp().z > 0.0f) if(GetUp().z > 0.0f)
dist += GetUp(); dist += GetUp();
obj->GetPosition() += GetUp(); obj->GetMatrix().GetPosition() += GetUp();
CWorld::Add(obj); CWorld::Add(obj);
@ -771,7 +771,7 @@ void
CBoat::Teleport(CVector v) CBoat::Teleport(CVector v)
{ {
CWorld::Remove(this); CWorld::Remove(this);
GetPosition() = v; SetPosition(v);
SetOrientation(0.0f, 0.0f, 0.0f); SetOrientation(0.0f, 0.0f, 0.0f);
SetMoveSpeed(0.0f, 0.0f, 0.0f); SetMoveSpeed(0.0f, 0.0f, 0.0f);
SetTurnSpeed(0.0f, 0.0f, 0.0f); SetTurnSpeed(0.0f, 0.0f, 0.0f);

View File

@ -59,7 +59,7 @@ void CCarGenerator::DoInternalProcessing()
if (pos.z <= -100.0f) if (pos.z <= -100.0f)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y); pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
pos.z += pBoat->GetDistanceFromCentreOfMassToBaseOfModel(); pos.z += pBoat->GetDistanceFromCentreOfMassToBaseOfModel();
pBoat->GetPosition() = pos; pBoat->SetPosition(pos);
pBoat->SetOrientation(0.0f, 0.0f, DEGTORAD(m_fAngle)); pBoat->SetOrientation(0.0f, 0.0f, DEGTORAD(m_fAngle));
pBoat->SetStatus(STATUS_ABANDONED); pBoat->SetStatus(STATUS_ABANDONED);
pBoat->m_nDoorLock = CARLOCK_UNLOCKED; pBoat->m_nDoorLock = CARLOCK_UNLOCKED;
@ -93,7 +93,7 @@ void CCarGenerator::DoInternalProcessing()
pCar->bIsStatic = false; pCar->bIsStatic = false;
pCar->bEngineOn = false; pCar->bEngineOn = false;
pos.z += pCar->GetDistanceFromCentreOfMassToBaseOfModel(); pos.z += pCar->GetDistanceFromCentreOfMassToBaseOfModel();
pCar->GetPosition() = pos; pCar->SetPosition(pos);
pCar->SetOrientation(0.0f, 0.0f, DEGTORAD(m_fAngle)); pCar->SetOrientation(0.0f, 0.0f, DEGTORAD(m_fAngle));
pCar->SetStatus(STATUS_ABANDONED); pCar->SetStatus(STATUS_ABANDONED);
pCar->bLightsOn = false; pCar->bLightsOn = false;

View File

@ -340,7 +340,7 @@ void CCrane::Update(void)
case GOING_TOWARDS_TARGET_ONLY_HEIGHT: case GOING_TOWARDS_TARGET_ONLY_HEIGHT:
case ROTATING_TARGET: case ROTATING_TARGET:
if (m_pVehiclePickedUp) { if (m_pVehiclePickedUp) {
m_pVehiclePickedUp->GetPosition() = CVector(m_vecHookCurPos.x, m_vecHookCurPos.y, m_vecHookCurPos.z - m_pVehiclePickedUp->GetColModel()->boundingBox.max.z); m_pVehiclePickedUp->SetPosition(m_vecHookCurPos.x, m_vecHookCurPos.y, m_vecHookCurPos.z - m_pVehiclePickedUp->GetColModel()->boundingBox.max.z);
m_pVehiclePickedUp->SetMoveSpeed(0.0f, 0.0f, 0.0f); m_pVehiclePickedUp->SetMoveSpeed(0.0f, 0.0f, 0.0f);
CVector up(vecHook.x - m_vecHookCurPos.x, vecHook.y - m_vecHookCurPos.y, 20.0f); CVector up(vecHook.x - m_vecHookCurPos.x, vecHook.y - m_vecHookCurPos.y, 20.0f);
up.Normalise(); up.Normalise();
@ -585,7 +585,7 @@ void CCrane::SetHookMatrix()
{ {
if (m_pHook == nil) if (m_pHook == nil)
return; return;
m_pHook->GetPosition() = m_vecHookCurPos; m_pHook->SetPosition(m_vecHookCurPos);
CVector up(m_vecHookInitPos.x - m_vecHookCurPos.x, m_vecHookInitPos.y - m_vecHookCurPos.y, 20.0f); CVector up(m_vecHookInitPos.x - m_vecHookCurPos.x, m_vecHookInitPos.y - m_vecHookCurPos.y, 20.0f);
up.Normalise(); up.Normalise();
m_pHook->GetRight() = CrossProduct(CVector(0.0f, 1.0f, 0.0f), up); m_pHook->GetRight() = CrossProduct(CVector(0.0f, 1.0f, 0.0f), up);

View File

@ -144,11 +144,11 @@ CHeli::ProcessControl(void)
if(GetPosition().z > 31.55f) if(GetPosition().z > 31.55f)
break; break;
m_pathState = 7; m_pathState = 7;
GetPosition().z = 31.55f; GetMatrix().GetPosition().z = 31.55f;
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f); m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
break; break;
case 7: case 7:
GetPosition().z = 31.55f; GetMatrix().GetPosition().z = 31.55f;
target = GetPosition(); target = GetPosition();
break; break;
@ -214,8 +214,8 @@ CHeli::ProcessControl(void)
vTargetDist = target - GetPosition(); vTargetDist = target - GetPosition();
m_fTargetZ = target.z; m_fTargetZ = target.z;
if(m_pathState == 6){ if(m_pathState == 6){
GetPosition().x = GetPosition().x*0.99f + target.x*0.01f; GetMatrix().GetPosition().x = GetMatrix().GetPosition().x*0.99f + target.x*0.01f;
GetPosition().y = GetPosition().y*0.99f + target.y*0.01f; GetMatrix().GetPosition().y = GetMatrix().GetPosition().y*0.99f + target.y*0.01f;
} }
}else{ }else{
vTargetDist = FindPlayerCoors() - GetPosition(); vTargetDist = FindPlayerCoors() - GetPosition();
@ -367,8 +367,8 @@ CHeli::ProcessControl(void)
m_vecMoveSpeed.x += speedDir.x*speedInc; m_vecMoveSpeed.x += speedDir.x*speedInc;
m_vecMoveSpeed.y += speedDir.y*speedInc; m_vecMoveSpeed.y += speedDir.y*speedInc;
} }
GetPosition().x += m_vecMoveSpeed.x*CTimer::GetTimeStep(); GetMatrix().GetPosition().x += m_vecMoveSpeed.x*CTimer::GetTimeStep();
GetPosition().y += m_vecMoveSpeed.y*CTimer::GetTimeStep(); GetMatrix().GetPosition().y += m_vecMoveSpeed.y*CTimer::GetTimeStep();
// Find z target // Find z target
if(m_heliStatus == HELI_STATUS_FLY_AWAY) if(m_heliStatus == HELI_STATUS_FLY_AWAY)
@ -389,7 +389,7 @@ CHeli::ProcessControl(void)
m_vecMoveSpeed.z -= speedIncZ; m_vecMoveSpeed.z -= speedIncZ;
else else
m_vecMoveSpeed.z += speedIncZ*1.5f; m_vecMoveSpeed.z += speedIncZ*1.5f;
GetPosition().z += m_vecMoveSpeed.z*CTimer::GetTimeStep(); GetMatrix().GetPosition().z += m_vecMoveSpeed.z*CTimer::GetTimeStep();
// Find angular speed // Find angular speed
float targetAngularSpeed; float targetAngularSpeed;

View File

@ -161,7 +161,7 @@ CTrain::ProcessControl(void)
CVector posFront = (1.0f - f)*trackNodes[curTrackNodeFront].p + f*trackNodes[nextTrackNodeFront].p; CVector posFront = (1.0f - f)*trackNodes[curTrackNodeFront].p + f*trackNodes[nextTrackNodeFront].p;
// Now set matrix // Now set matrix
GetPosition() = (posRear + posFront)/2.0f; SetPosition((posRear + posFront)/2.0f);
CVector fwd = posFront - posRear; CVector fwd = posFront - posRear;
fwd.Normalise(); fwd.Normalise();
CVector right = CrossProduct(fwd, CVector(0.0f, 0.0f, 1.0f)); CVector right = CrossProduct(fwd, CVector(0.0f, 0.0f, 1.0f));

View File

@ -245,7 +245,7 @@ CProjectileInfo::IsProjectileInRange(float x1, float x2, float y1, float y2, flo
for (int i = 0; i < ARRAY_SIZE(ms_apProjectile); i++) { for (int i = 0; i < ARRAY_SIZE(ms_apProjectile); i++) {
if (gaProjectileInfo[i].m_bInUse) { if (gaProjectileInfo[i].m_bInUse) {
if (gaProjectileInfo[i].m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER || gaProjectileInfo[i].m_eWeaponType == WEAPONTYPE_MOLOTOV || gaProjectileInfo[i].m_eWeaponType == WEAPONTYPE_GRENADE) { if (gaProjectileInfo[i].m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER || gaProjectileInfo[i].m_eWeaponType == WEAPONTYPE_MOLOTOV || gaProjectileInfo[i].m_eWeaponType == WEAPONTYPE_GRENADE) {
CVector &pos = ms_apProjectile[i]->GetPosition(); const CVector &pos = ms_apProjectile[i]->GetPosition();
if (pos.x >= x1 && pos.x <= x2 && pos.y >= y1 && pos.y <= y2 && pos.z >= z1 && pos.z <= z2) { if (pos.x >= x1 && pos.x <= x2 && pos.y >= y1 && pos.y <= y2 && pos.z >= z1 && pos.z <= z2) {
result = true; result = true;
if (remove) { if (remove) {