summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-10-18 16:17:11 +0200
committerSergeanur <s.anureev@yandex.ua>2020-10-18 16:17:11 +0200
commit8697eebbc237ceb0ed0d395a8c22440b9a1c15b8 (patch)
treeed2b2d923a03196c639e6f897f404b1caec0772d
parentMerge remote-tracking branch 'origin/miami' into VC/Pickups (diff)
parentMerge branch 'master' into miami (diff)
downloadre3-8697eebbc237ceb0ed0d395a8c22440b9a1c15b8.tar
re3-8697eebbc237ceb0ed0d395a8c22440b9a1c15b8.tar.gz
re3-8697eebbc237ceb0ed0d395a8c22440b9a1c15b8.tar.bz2
re3-8697eebbc237ceb0ed0d395a8c22440b9a1c15b8.tar.lz
re3-8697eebbc237ceb0ed0d395a8c22440b9a1c15b8.tar.xz
re3-8697eebbc237ceb0ed0d395a8c22440b9a1c15b8.tar.zst
re3-8697eebbc237ceb0ed0d395a8c22440b9a1c15b8.zip
-rw-r--r--src/audio/AudioLogic.cpp30
-rw-r--r--src/control/Pickups.cpp5
-rw-r--r--src/control/RoadBlocks.cpp2
-rw-r--r--src/control/Script.cpp14
-rw-r--r--src/core/Cam.cpp2
-rw-r--r--src/core/Radar.cpp2
-rw-r--r--src/core/World.cpp18
-rw-r--r--src/entities/Entity.h3
-rw-r--r--src/entities/Physical.cpp26
-rw-r--r--src/objects/Object.cpp16
-rw-r--r--src/peds/CivilianPed.cpp2
-rw-r--r--src/peds/Ped.cpp137
-rw-r--r--src/peds/Population.cpp2
-rw-r--r--src/render/Glass.cpp4
-rw-r--r--src/render/SpecialFX.cpp35
-rw-r--r--src/skel/glfw/glfw.cpp1
-rw-r--r--src/skel/win/win.cpp1
-rw-r--r--src/vehicles/Automobile.cpp6
-rw-r--r--src/vehicles/Boat.cpp2
-rw-r--r--src/vehicles/Heli.cpp2
-rw-r--r--src/weapons/BulletInfo.cpp4
-rw-r--r--src/weapons/Weapon.cpp16
22 files changed, 181 insertions, 149 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 9a8dda28..6ea93f6d 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -1,4 +1,4 @@
-#include "common.h"
+#include "common.h"
#include "AudioManager.h"
#include "audio_enums.h"
@@ -993,7 +993,7 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams *params)
int32 emittingVol;
uint32 freq;
- float modificator;
+ float multiplier;
int sampleFreq;
float velocity;
@@ -1016,9 +1016,9 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams *params)
freq = 6050 * emittingVol / 30 + 16000;
} else {
m_sQueueSample.m_nSampleIndex = SFX_ROAD_NOISE;
- modificator = m_sQueueSample.m_fDistance / 190.f;
+ multiplier = (m_sQueueSample.m_fDistance / SOUND_INTENSITY) * 0.5f;
sampleFreq = SampleManager.GetSampleBaseFrequency(SFX_ROAD_NOISE);
- freq = (sampleFreq * modificator) + ((3 * sampleFreq) / 4);
+ freq = (sampleFreq * multiplier) + ((3 * sampleFreq) / 4);
}
m_sQueueSample.m_nFrequency = freq;
m_sQueueSample.m_nLoopCount = 0;
@@ -1046,7 +1046,7 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams *params)
float relativeVelocity;
int32 emittingVol;
- float modificator;
+ float multiplier;
int freq;
float velChange;
@@ -1066,9 +1066,13 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams *params)
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_nReleasingVolumeModificator = 3;
- modificator = m_sQueueSample.m_fDistance / 6.f;
+#ifdef FIX_BUGS
+ multiplier = (m_sQueueSample.m_fDistance / SOUND_INTENSITY) * 0.5f;
+#else
+ multiplier = (m_sQueueSample.m_fDistance / 3.0f) * 0.5f;
+#endif
freq = SampleManager.GetSampleBaseFrequency(SFX_ROAD_NOISE);
- m_sQueueSample.m_nFrequency = freq + freq * modificator;
+ m_sQueueSample.m_nFrequency = freq + freq * multiplier;
m_sQueueSample.m_nLoopCount = 0;
m_sQueueSample.m_nEmittingVolume = emittingVol;
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
@@ -4923,17 +4927,25 @@ cAudioManager::ProcessFires(int32)
void
cAudioManager::ProcessWaterCannon(int32)
{
- const float SOUND_INTENSITY = 900.0f;
+ const float SOUND_INTENSITY = 30.0f;
for (int32 i = 0; i < NUM_WATERCANNONS; i++) {
if (CWaterCannons::aCannons[i].m_nId) {
m_sQueueSample.m_vecPos = CWaterCannons::aCannons[0].m_avecPos[CWaterCannons::aCannons[i].m_nCur];
float distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos);
- if (distSquared < SOUND_INTENSITY) {
+ if (distSquared < SQR(SOUND_INTENSITY)) {
m_sQueueSample.m_fDistance = Sqrt(distSquared);
+#ifdef FIX_BUGS
+ m_sQueueSample.m_nVolume = ComputeVolume(50, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
+#else
m_sQueueSample.m_nVolume = ComputeVolume(50, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance);
+#endif
if (m_sQueueSample.m_nVolume != 0) {
+#ifdef FIX_BUGS
m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY;
+#else
+ m_sQueueSample.m_fSoundIntensity = SQR(SOUND_INTENSITY);
+#endif
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_nFrequency = 15591;
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 720b77f6..ddf7cefb 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -855,7 +855,7 @@ CPickups::Update()
#ifdef CAMERA_PICKUP
if ( bPickUpcamActivated ) // taken from PS2
{
- float dist = (FindPlayerCoors() - StaticCamCoors).Magnitude2D();
+ float dist = Distance2D(StaticCamCoors, FindPlayerCoors());
float mult;
if ( dist < 10.0f )
mult = 1.0f - (dist / 10.0f );
@@ -871,8 +871,7 @@ CPickups::Update()
TheCamera.TakeControl(FindPlayerVehicle(), CCam::MODE_FIXED, JUMP_CUT, CAMCONTROL_SCRIPT);
}
- if ( FindPlayerVehicle() != pPlayerVehicle
- || (FindPlayerCoors() - StaticCamCoors).Magnitude() > 40.0f
+ if ( FindPlayerVehicle() != pPlayerVehicle || Distance(StaticCamCoors, FindPlayerCoors()) > 40.0f
|| ((CTimer::GetTimeInMilliseconds() - StaticCamStartTime) > 60000) )
{
TheCamera.RestoreWithJumpCut();
diff --git a/src/control/RoadBlocks.cpp b/src/control/RoadBlocks.cpp
index e7831b82..dee2cbe3 100644
--- a/src/control/RoadBlocks.cpp
+++ b/src/control/RoadBlocks.cpp
@@ -236,7 +236,7 @@ CRoadBlocks::CreateRoadBlockBetween2Points(CVector point1, CVector point2)
tmp.GetPosition().z += fModelRadius - 0.6f;
pVehicle->m_matrix = tmp;
pVehicle->PlaceOnRoadProperly();
- pVehicle->bIsStatic = false;
+ pVehicle->SetIsStatic(false);
pVehicle->m_matrix.UpdateRW();
pVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
CCarCtrl::JoinCarWithRoadSystem(pVehicle);
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 01a4405d..a2ab5f0b 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -1704,7 +1704,7 @@ static void PossiblyWakeThisEntity(CPhysical* pEntity, bool ifColLoaded = false)
return;
if (!ifColLoaded || CColStore::HasCollisionLoaded(pEntity->GetPosition())) {
pEntity->bIsStaticWaitingForCollision = false;
- if (!pEntity->IsStatic())
+ if (!pEntity->GetIsStatic())
pEntity->AddToMovingList();
}
}
@@ -2381,9 +2381,11 @@ void CTheScripts::Process()
case 4:
AllowMissionReplay = 5;
RetryMission(0, 0);
+ break;
case 6:
AllowMissionReplay = 7;
TimeToWaitTill = CTimer::GetTimeInMilliseconds() + 500;
+ break;
case 7:
if (TimeToWaitTill < CTimer::GetTimeInMilliseconds()) {
AllowMissionReplay = 0;
@@ -3971,7 +3973,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
if (pos.z <= MAP_Z_LOW_LIMIT)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
pos.z += car->GetDistanceFromCentreOfMassToBaseOfModel();
- car->bIsStatic = false;
+ car->SetIsStatic(false);
/* Again weird usage of virtual functions. */
if (car->IsBoat()) {
car->Teleport(pos);
@@ -9647,13 +9649,13 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
script_assert(pObject);
if (ScriptParams[1]) {
if (pObject->bIsStatic) {
- pObject->bIsStatic = false;
+ pObject->SetIsStatic(false);
pObject->AddToMovingList();
}
}
else {
if (!pObject->bIsStatic) {
- pObject->bIsStatic = true;
+ pObject->SetIsStatic(true);
pObject->RemoveFromMovingList();
}
}
@@ -13725,7 +13727,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
pVehicle->bDontLoadCollision = true;
if (pVehicle->bIsStaticWaitingForCollision) {
pVehicle->bIsStaticWaitingForCollision = false;
- if (!pVehicle->IsStatic())
+ if (!pVehicle->GetIsStatic())
pVehicle->AddToMovingList();
}
}
@@ -13748,7 +13750,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
pPed->bDontLoadCollision = true;
if (pPed->bIsStaticWaitingForCollision) {
pPed->bIsStaticWaitingForCollision = false;
- if (!pPed->IsStatic())
+ if (!pPed->GetIsStatic())
pPed->AddToMovingList();
}
}
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index b996e77f..7af652ad 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -4247,7 +4247,7 @@ CCam::GetLookFromLampPostPos(CEntity *Target, CPed *Cop, CVector &TargetCoors, C
CWorld::FindObjectsInRange(TargetCoors, 30.0f, true, &NumObjects, 15, Objects, false, false, false, true, true);
float NearestDist = 10000.0f;
for(i = 0; i < NumObjects; i++){
- if(Objects[i]->IsStatic() && Objects[i]->GetUp().z > 0.9f && IsLampPost(Objects[i]->GetModelIndex())){
+ if(Objects[i]->GetIsStatic() && Objects[i]->GetUp().z > 0.9f && IsLampPost(Objects[i]->GetModelIndex())){
float Dist = (Objects[i]->GetPosition() - TargetCoors).Magnitude2D();
if(Abs(ARRESTCAM_LAMP_BEST_DIST - Dist) < NearestDist){
CVector TestStart = Objects[i]->GetColModel()->boundingBox.max;
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 78166252..4556e3b4 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -272,7 +272,7 @@ uint8 CRadar::CalculateBlipAlpha(float dist)
return 255;
if (dist <= 10.0f)
- return (128.0f * ((dist - 1.0f) / 4.0f)) + ((1.0f - (dist - 1.0f) / 4.0f) * 255.0f);
+ return (128.0f * ((dist - 1.0f) / 9.0f)) + ((1.0f - (dist - 1.0f) / 9.0f) * 255.0f);
return 128;
}
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 6d5e8a81..14c06a81 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -79,7 +79,7 @@ CWorld::Add(CEntity *ent)
if(ent->IsBuilding() || ent->IsDummy()) return;
- if(!ent->IsStatic()) ((CPhysical *)ent)->AddToMovingList();
+ if(!ent->GetIsStatic()) ((CPhysical *)ent)->AddToMovingList();
}
void
@@ -94,7 +94,7 @@ CWorld::Remove(CEntity *ent)
if(ent->IsBuilding() || ent->IsDummy()) return;
- if(!ent->IsStatic()) ((CPhysical *)ent)->RemoveFromMovingList();
+ if(!ent->GetIsStatic()) ((CPhysical *)ent)->RemoveFromMovingList();
}
void
@@ -1962,7 +1962,7 @@ CWorld::Process(void)
RemoveEntityInsteadOfProcessingIt(movingEnt);
} else {
movingEnt->ProcessControl();
- if(movingEnt->IsStatic()) { movingEnt->RemoveFromMovingList(); }
+ if(movingEnt->GetIsStatic()) { movingEnt->RemoveFromMovingList(); }
}
}
bForceProcessControl = true;
@@ -1973,7 +1973,7 @@ CWorld::Process(void)
RemoveEntityInsteadOfProcessingIt(movingEnt);
} else {
movingEnt->ProcessControl();
- if(movingEnt->IsStatic()) { movingEnt->RemoveFromMovingList(); }
+ if(movingEnt->GetIsStatic()) { movingEnt->RemoveFromMovingList(); }
}
}
}
@@ -2133,13 +2133,13 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
CObject *pObject = (CObject *)pEntity;
CVehicle *pVehicle = (CVehicle *)pEntity;
if(!pEntity->bExplosionProof && (!pEntity->IsPed() || !pPed->bInVehicle)) {
- if(pEntity->IsStatic()) {
+ if(pEntity->GetIsStatic()) {
if(pEntity->IsObject()) {
if (fPower > pObject->m_fUprootLimit || IsFence(pObject->GetModelIndex())) {
if (IsGlass(pObject->GetModelIndex())) {
CGlass::WindowRespondsToExplosion(pObject, position);
} else {
- pObject->bIsStatic = false;
+ pObject->SetIsStatic(false);
pObject->AddToMovingList();
int16 modelId = pEntity->GetModelIndex();
if(modelId != MI_FIRE_HYDRANT ||
@@ -2157,18 +2157,18 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
}
}
}
- if(pEntity->IsStatic()) {
+ if(pEntity->GetIsStatic()) {
float fDamageMultiplier =
(fRadius - fMagnitude) * 2.0f / fRadius;
float fDamage = 300.0f * Min(fDamageMultiplier, 1.0f);
pObject->ObjectDamage(fDamage);
}
} else {
- pEntity->bIsStatic = false;
+ pEntity->SetIsStatic(false);
pEntity->AddToMovingList();
}
}
- if(!pEntity->IsStatic()) {
+ if(!pEntity->GetIsStatic()) {
float fDamageMultiplier = Min((fRadius - fMagnitude) * 2.0f / fRadius, 1.0f);
CVector vecForceDir =
vecDistance * (fPower * pEntity->m_fMass * 0.00071429f * fDamageMultiplier /
diff --git a/src/entities/Entity.h b/src/entities/Entity.h
index fbf5cb3b..08d1900a 100644
--- a/src/entities/Entity.h
+++ b/src/entities/Entity.h
@@ -104,7 +104,8 @@ public:
eEntityStatus GetStatus() const { return (eEntityStatus)m_status; }
void SetStatus(eEntityStatus status) { m_status = status; }
CColModel *GetColModel(void) { return CModelInfo::GetModelInfo(m_modelIndex)->GetColModel(); }
- bool IsStatic(void) { return bIsStatic || bIsStaticWaitingForCollision; }
+ bool GetIsStatic(void) const { return bIsStatic || bIsStaticWaitingForCollision; }
+ void SetIsStatic(bool state) { bIsStatic = state; }
#ifdef COMPATIBLE_SAVES
void SaveEntityFlags(uint8*& buf);
void LoadEntityFlags(uint8*& buf);
diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp
index b190d03a..5483641f 100644
--- a/src/entities/Physical.cpp
+++ b/src/entities/Physical.cpp
@@ -344,7 +344,7 @@ CPhysical::ProcessEntityCollision(CEntity *ent, CColPoint *colpoints)
AddCollisionRecord(ent);
if(!ent->IsBuilding()) // Can't this catch dummies too?
((CPhysical*)ent)->AddCollisionRecord(this);
- if(ent->IsBuilding() || ent->IsStatic())
+ if(ent->IsBuilding() || ent->GetIsStatic())
this->bHasHitWall = true;
}
return numSpheres;
@@ -380,7 +380,7 @@ CPhysical::ProcessControl(void)
m_nStaticFrames++;
if(m_nStaticFrames > 10){
m_nStaticFrames = 10;
- bIsStatic = true;
+ SetIsStatic(true);
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
m_vecMoveFriction = m_vecMoveSpeed;
@@ -614,7 +614,7 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl
}
float speedA, speedB;
- if(B->IsStatic() && !foo){
+ if(B->GetIsStatic() && !foo){
if(A->bPedPhysics){
speedA = DotProduct(A->m_vecMoveSpeed, colpoint.normal);
if(speedA < 0.0f){
@@ -625,7 +625,7 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl
if(IsGlass(B->GetModelIndex()))
CGlass::WindowRespondsToCollision(B, impulseA, A->m_vecMoveSpeed, colpoint.point, false);
else if(!B->bInfiniteMass){
- B->bIsStatic = false;
+ B->SetIsStatic(false);
CWorld::Players[CWorld::PlayerInFocus].m_nHavocLevel += 2;
CStats::PropertyDestroyed += CGeneral::GetRandomNumberInRange(30, 60);
}
@@ -637,7 +637,7 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl
return true;
}
}else if(!B->bInfiniteMass)
- B->bIsStatic = false;
+ B->SetIsStatic(false);
if(B->bInfiniteMass){
impulseA = -speedA * A->m_fMass;
@@ -675,7 +675,7 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl
if(IsGlass(B->GetModelIndex()))
CGlass::WindowRespondsToCollision(B, impulseA, A->m_vecMoveSpeed, colpoint.point, false);
else
- B->bIsStatic = false;
+ B->SetIsStatic(false);
int16 model = B->GetModelIndex();
if(model == MI_FIRE_HYDRANT && !Bobj->bHasBeenDamaged){
CParticleObject::AddObject(POBJECT_FIRE_HYDRANT, B->GetPosition() - CVector(0.0f, 0.0f, 0.5f), true);
@@ -699,11 +699,11 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl
return true;
}
}else if(!B->bInfiniteMass)
- B->bIsStatic = false;
+ B->SetIsStatic(false);
}
}
- if(B->IsStatic())
+ if(B->GetIsStatic())
return false;
if(!B->bInfiniteMass && !B->m_phy_flagA08)
B->AddToMovingList();
@@ -1231,7 +1231,7 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists)
canshift = true;
else
canshift = A->IsPed() &&
- B->IsObject() && B->IsStatic() && !Bobj->bHasBeenDamaged;
+ B->IsObject() && B->GetIsStatic() && !Bobj->bHasBeenDamaged;
if(B == A ||
B->m_scanCode == CWorld::GetCurrentScanCode() ||
!B->bUsesCollision ||
@@ -1255,7 +1255,7 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists)
CObject *Aobj = (CObject*)A;
if(Aobj->ObjectCreatedBy != TEMP_OBJECT &&
!Aobj->bHasBeenDamaged &&
- Aobj->IsStatic()){
+ Aobj->GetIsStatic()){
if(Aobj->m_pCollidingEntity == B)
Aobj->m_pCollidingEntity = nil;
}else if(Aobj->m_pCollidingEntity != B){
@@ -1272,7 +1272,7 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists)
CObject *Bobj = (CObject*)B;
if(Bobj->ObjectCreatedBy != TEMP_OBJECT &&
!Bobj->bHasBeenDamaged &&
- Bobj->IsStatic()){
+ Bobj->GetIsStatic()){
if(Bobj->m_pCollidingEntity == A)
Bobj->m_pCollidingEntity = nil;
}else if(Bobj->m_pCollidingEntity != A){
@@ -1595,7 +1595,7 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists)
skipCollision = true;
else if(Aobj->ObjectCreatedBy == TEMP_OBJECT ||
Aobj->bHasBeenDamaged ||
- !Aobj->IsStatic()){
+ !Aobj->GetIsStatic()){
if(Aobj->m_pCollidingEntity == B)
skipCollision = true;
else if(Aobj->m_nCollisionDamageEffect < DAMAGE_EFFECT_SMASH_COMPLETELY){
@@ -1614,7 +1614,7 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists)
skipCollision = true;
else if(Bobj->ObjectCreatedBy == TEMP_OBJECT ||
Bobj->bHasBeenDamaged ||
- !Bobj->IsStatic()){
+ !Bobj->GetIsStatic()){
if(Bobj->m_pCollidingEntity == A)
skipCollision = true;
else if(Bobj->m_nCollisionDamageEffect < DAMAGE_EFFECT_SMASH_COMPLETELY){
diff --git a/src/objects/Object.cpp b/src/objects/Object.cpp
index 9a9eaa73..8b78bdbd 100644
--- a/src/objects/Object.cpp
+++ b/src/objects/Object.cpp
@@ -98,7 +98,7 @@ CObject::ProcessControl(void)
CPhysical::ProcessControl();
if (mod_Buoyancy.ProcessBuoyancy(this, m_fBuoyancy, &point, &impulse)) {
bIsInWater = true;
- bIsStatic = false;
+ SetIsStatic(false);
ApplyMoveForce(impulse);
ApplyTurnForce(impulse, point);
float fTimeStep = Pow(0.97f, CTimer::GetTimeStep());
@@ -197,7 +197,7 @@ CObject::ObjectDamage(float amount)
case DAMAGE_EFFECT_SMASH_COMPLETELY:
bIsVisible = false;
bUsesCollision = false;
- bIsStatic = true;
+ SetIsStatic(true);
bExplosionProof = true;
SetMoveSpeed(0.0f, 0.0f, 0.0f);
SetTurnSpeed(0.0f, 0.0f, 0.0f);
@@ -209,7 +209,7 @@ CObject::ObjectDamage(float amount)
else {
bIsVisible = false;
bUsesCollision = false;
- bIsStatic = true;
+ SetIsStatic(true);
bExplosionProof = true;
SetMoveSpeed(0.0f, 0.0f, 0.0f);
SetTurnSpeed(0.0f, 0.0f, 0.0f);
@@ -218,7 +218,7 @@ CObject::ObjectDamage(float amount)
case DAMAGE_EFFECT_SMASH_CARDBOARD_COMPLETELY: {
bIsVisible = false;
bUsesCollision = false;
- bIsStatic = true;
+ SetIsStatic(true);
bExplosionProof = true;
SetMoveSpeed(0.0f, 0.0f, 0.0f);
SetTurnSpeed(0.0f, 0.0f, 0.0f);
@@ -241,7 +241,7 @@ CObject::ObjectDamage(float amount)
case DAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY: {
bIsVisible = false;
bUsesCollision = false;
- bIsStatic = true;
+ SetIsStatic(true);
bExplosionProof = true;
SetMoveSpeed(0.0f, 0.0f, 0.0f);
SetTurnSpeed(0.0f, 0.0f, 0.0f);
@@ -264,7 +264,7 @@ CObject::ObjectDamage(float amount)
case DAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY: {
bIsVisible = false;
bUsesCollision = false;
- bIsStatic = true;
+ SetIsStatic(true);
bExplosionProof = true;
SetMoveSpeed(0.0f, 0.0f, 0.0f);
SetTurnSpeed(0.0f, 0.0f, 0.0f);
@@ -289,7 +289,7 @@ CObject::ObjectDamage(float amount)
case DAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY: {
bIsVisible = false;
bUsesCollision = false;
- bIsStatic = true;
+ SetIsStatic(true);
bExplosionProof = true;
SetMoveSpeed(0.0f, 0.0f, 0.0f);
SetTurnSpeed(0.0f, 0.0f, 0.0f);
@@ -329,7 +329,7 @@ CObject::Init(void)
CObjectData::SetObjectData(GetModelIndex(), *this);
m_nEndOfLifeTime = 0;
ObjectCreatedBy = GAME_OBJECT;
- bIsStatic = true;
+ SetIsStatic(true);
bIsPickup = false;
bPickupObjWithMessage = false;
bOutOfStock = false;
diff --git a/src/peds/CivilianPed.cpp b/src/peds/CivilianPed.cpp
index 1950c4b3..74a7c9ba 100644
--- a/src/peds/CivilianPed.cpp
+++ b/src/peds/CivilianPed.cpp
@@ -425,7 +425,7 @@ void CCivilianPed::FindNearbyAttractorsSectorList(CPtrList& list, float& minDist
{
for (CPtrNode* pNode = list.first; pNode != nil; pNode = pNode->next) {
CEntity* pEntity = (CEntity*)pNode->item;
- if (pEntity->IsObject() && (!pEntity->IsStatic() || ((CObject*)pEntity)->bHasBeenDamaged))
+ if (pEntity->IsObject() && (!pEntity->GetIsStatic() || ((CObject*)pEntity)->bHasBeenDamaged))
continue;
CBaseModelInfo* pModelInfo = CModelInfo::GetModelInfo(pEntity->GetModelIndex());
for (int i = 0; i < pModelInfo->GetNum2dEffects(); i++) {
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index c5b19241..3f573171 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -15403,17 +15403,17 @@ CPed::ProcessObjective(void)
CVector distance = m_nextRoutePointPos - GetPosition();
distance.z = 0.0f;
if (m_objective == OBJECTIVE_GOTO_SHELTER_ON_FOOT) {
- if (m_nMoveState == PEDMOVE_SPRINT && distance.Magnitude() < SQR(2.0f)) {
+ if (m_nMoveState == PEDMOVE_RUN && distance.Magnitude() < SQR(2.0f)) {
SetMoveState(PEDMOVE_WALK);
bIsRunning = false;
}
- else if (CWeather::Rain < 0.2f && m_attractor) {
+ if (CWeather::Rain < 0.2f && m_attractor) {
GetPedAttractorManager()->DeRegisterPed(this, m_attractor);
return;
}
}
else if (m_objective == OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT) {
- if (m_nMoveState == PEDMOVE_SPRINT && distance.Magnitude() < SQR(4.0f)) {
+ if (m_nMoveState == PEDMOVE_RUN && distance.Magnitude() < SQR(4.0f)) {
SetMoveState(PEDMOVE_WALK);
bIsRunning = false;
}
@@ -15439,8 +15439,10 @@ CPed::ProcessObjective(void)
}
}
if (sq(m_distanceToCountSeekDone) < distance.MagnitudeSqr()) {
- if (CTimer::GetTimeInMilliseconds() > m_nPedStateTimer || GetPedState() != PED_SEEK_POS)
+ if (CTimer::GetTimeInMilliseconds() > m_nPedStateTimer || GetPedState() != PED_SEEK_POS) {
+ m_vecSeekPos = m_nextRoutePointPos;
SetSeek(m_vecSeekPos, m_distanceToCountSeekDone);
+ }
}
else {
if (!bReachedAttractorHeadingTarget) {
@@ -15510,6 +15512,10 @@ CPed::ProcessObjective(void)
SetObjective(OBJECTIVE_WAIT_ON_FOOT_AT_ICE_CREAM_VAN);
break;
}
+ } else {
+ m_prevObjective = OBJECTIVE_NONE;
+ SetObjective(OBJECTIVE_WAIT_ON_FOOT);
+ m_objectiveTimer = 0;
}
}
}
@@ -15693,11 +15699,11 @@ CPed::ProcessObjective(void)
}
if (!pVan->m_bSirenOrAlarm) {
GetPedAttractorManager()->DeRegisterPed(this, m_attractor);
- return; // ???
+ return; // Why?
}
if (pVan->GetStatus() == STATUS_WRECKED) {
GetPedAttractorManager()->DeRegisterPed(this, m_attractor);
- return; // ???
+ return; // Why?
}
break;
}
@@ -16422,11 +16428,11 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
if (!collidingEnt->IsBuilding())
((CPhysical*)collidingEnt)->AddCollisionRecord(this);
- if (ourCollidedSpheres > 0 && (collidingEnt->IsBuilding() || collidingEnt->IsStatic())) {
+ if (ourCollidedSpheres > 0 && (collidingEnt->IsBuilding() || collidingEnt->GetIsStatic())) {
bHasHitWall = true;
}
}
- if (collidingEnt->IsBuilding() || collidingEnt->IsStatic()) {
+ if (collidingEnt->IsBuilding() || collidingEnt->GetIsStatic()) {
if (bWasStanding) {
CVector sphereNormal;
float normalLength;
@@ -17003,72 +17009,69 @@ CPed::ProcessBuoyancy(void)
}
}
}
- float speedMult = 0.0f;
- if (buoyancyImpulse.z / m_fMass > GRAVITY * CTimer::GetTimeStep()
- || mod_Buoyancy.m_waterlevel > GetPosition().z) {
+ }
+ float speedMult = 0.0f;
+ if (buoyancyImpulse.z / m_fMass > GRAVITY * CTimer::GetTimeStep()
+ || mod_Buoyancy.m_waterlevel > GetPosition().z + 0.6f) {
+ speedMult = pow(0.9f, CTimer::GetTimeStep());
+ m_vecMoveSpeed.x *= speedMult;
+ m_vecMoveSpeed.y *= speedMult;
+ m_vecMoveSpeed.z *= speedMult;
+ bIsStanding = false;
+ bIsDrowning = true;
+ InflictDamage(nil, WEAPONTYPE_DROWNING, 3.0f * CTimer::GetTimeStep(), PEDPIECE_TORSO, 0);
+ }
+ if (buoyancyImpulse.z / m_fMass > GRAVITY * 0.25f * CTimer::GetTimeStep()) {
+ if (speedMult == 0.0f) {
speedMult = pow(0.9f, CTimer::GetTimeStep());
- m_vecMoveSpeed.x *= speedMult;
- m_vecMoveSpeed.y *= speedMult;
- m_vecMoveSpeed.z *= speedMult;
- bIsStanding = false;
- bIsDrowning = true;
- InflictDamage(nil, WEAPONTYPE_DROWNING, 3.0f * CTimer::GetTimeStep(), PEDPIECE_TORSO, 0);
- }
- if (buoyancyImpulse.z / m_fMass > GRAVITY * 0.25f * CTimer::GetTimeStep()) {
- if (speedMult == 0.0f) {
- speedMult = pow(0.9f, CTimer::GetTimeStep());
- }
- m_vecMoveSpeed.x *= speedMult;
- m_vecMoveSpeed.y *= speedMult;
- if (m_vecMoveSpeed.z >= -0.1f) {
- if (m_vecMoveSpeed.z < -0.04f)
- m_vecMoveSpeed.z = -0.02f;
- } else {
- m_vecMoveSpeed.z = -0.01f;
- DMAudio.PlayOneShot(m_audioEntityId, SOUND_SPLASH, 0.0f);
- CVector aBitForward = 2.2f * m_vecMoveSpeed + GetPosition();
- float level = 0.0f;
- if (CWaterLevel::GetWaterLevel(aBitForward, &level, false))
- aBitForward.z = level;
-
- CParticleObject::AddObject(POBJECT_PED_WATER_SPLASH, aBitForward, CVector(0.0f, 0.0f, 0.1f), 0.0f, 200, color, true);
- nGenerateRaindrops = CTimer::GetTimeInMilliseconds() + 80;
- nGenerateWaterCircles = CTimer::GetTimeInMilliseconds() + 100;
- }
}
- } else
- return;
- } else
- bTouchingWater = false;
-
- if (nGenerateWaterCircles && CTimer::GetTimeInMilliseconds() >= nGenerateWaterCircles) {
- CVector pos = GetPosition();
- float level = 0.0f;
- if (CWaterLevel::GetWaterLevel(pos, &level, false))
- pos.z = level;
+ m_vecMoveSpeed.x *= speedMult;
+ m_vecMoveSpeed.y *= speedMult;
+ if (m_vecMoveSpeed.z >= -0.1f) {
+ if (m_vecMoveSpeed.z < -0.04f)
+ m_vecMoveSpeed.z = -0.02f;
+ } else {
+ m_vecMoveSpeed.z = -0.01f;
+ DMAudio.PlayOneShot(m_audioEntityId, SOUND_SPLASH, 0.0f);
+ CVector aBitForward = 2.2f * m_vecMoveSpeed + GetPosition();
+ float level = 0.0f;
+ if (CWaterLevel::GetWaterLevel(aBitForward, &level, false))
+ aBitForward.z = level;
- if (pos.z != 0.0f) {
- nGenerateWaterCircles = 0;
- for(int i = 0; i < 4; i++) {
- pos.x += CGeneral::GetRandomNumberInRange(-0.75f, 0.75f);
- pos.y += CGeneral::GetRandomNumberInRange(-0.75f, 0.75f);
- CParticle::AddParticle(PARTICLE_RAIN_SPLASH_BIGGROW, pos, CVector(0.0f, 0.0f, 0.0f), nil, 0.0f, color, 0, 0, 0, 0);
+ CParticleObject::AddObject(POBJECT_PED_WATER_SPLASH, aBitForward, CVector(0.0f, 0.0f, 0.1f), 0.0f, 200, color, true);
+ nGenerateRaindrops = CTimer::GetTimeInMilliseconds() + 80;
+ nGenerateWaterCircles = CTimer::GetTimeInMilliseconds() + 100;
}
}
- }
+ if (nGenerateWaterCircles && CTimer::GetTimeInMilliseconds() >= nGenerateWaterCircles) {
+ CVector pos = GetPosition();
+ float level = 0.0f;
+ if (CWaterLevel::GetWaterLevel(pos, &level, false))
+ pos.z = level;
- if (nGenerateRaindrops && CTimer::GetTimeInMilliseconds() >= nGenerateRaindrops) {
- CVector pos = GetPosition();
- float level = 0.0f;
- if (CWaterLevel::GetWaterLevel(pos, &level, false))
- pos.z = level;
+ if (pos.z != 0.0f) {
+ nGenerateWaterCircles = 0;
+ for(int i = 0; i < 4; i++) {
+ pos.x += CGeneral::GetRandomNumberInRange(-0.75f, 0.75f);
+ pos.y += CGeneral::GetRandomNumberInRange(-0.75f, 0.75f);
+ CParticle::AddParticle(PARTICLE_RAIN_SPLASH_BIGGROW, pos, CVector(0.0f, 0.0f, 0.0f), nil, 0.0f, color, 0, 0, 0, 0);
+ }
+ }
+ }
+ if (nGenerateRaindrops && CTimer::GetTimeInMilliseconds() >= nGenerateRaindrops) {
+ CVector pos = GetPosition();
+ float level = 0.0f;
+ if (CWaterLevel::GetWaterLevel(pos, &level, false))
+ pos.z = level;
- if (pos.z >= 0.0f) {
- pos.z += 0.25f;
- nGenerateRaindrops = 0;
- CParticleObject::AddObject(POBJECT_SPLASHES_AROUND, pos, CVector(0.0f, 0.0f, 0.0f), 4.5f, 1500, CRGBA(0,0,0,0), true);
+ if (pos.z >= 0.0f) {
+ pos.z += 0.25f;
+ nGenerateRaindrops = 0;
+ CParticleObject::AddObject(POBJECT_SPLASHES_AROUND, pos, CVector(0.0f, 0.0f, 0.0f), 4.5f, 1500, CRGBA(0,0,0,0), true);
+ }
}
- }
+ } else
+ bTouchingWater = false;
}
// --MIAMI: Done
@@ -18411,7 +18414,7 @@ CPed::SeekCar(void)
{
m_fRotationCur = m_fRotationDest;
if (!bVehEnterDoorIsBlocked) {
- vehToSeek->bIsStatic = false;
+ vehToSeek->SetIsStatic(false);
if (m_objective == OBJECTIVE_SOLICIT_VEHICLE) {
SetSolicit(1000);
} else if (m_objective == OBJECTIVE_BUY_ICE_CREAM) {
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp
index 94533f4a..d52c8c7c 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -945,7 +945,7 @@ CPopulation::ConvertToRealObject(CDummyObject *dummy)
if (IsGlass(obj->GetModelIndex()) && !mi->m_isArtistGlass) {
obj->bIsVisible = false;
} else if (obj->GetModelIndex() == MI_BUOY) {
- obj->bIsStatic = false;
+ obj->SetIsStatic(false);
obj->m_vecMoveSpeed = CVector(0.0f, 0.0f, -0.001f);
obj->bTouchingWater = true;
obj->AddToMovingList();
diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp
index c52d49bd..aabb6e52 100644
--- a/src/render/Glass.cpp
+++ b/src/render/Glass.cpp
@@ -393,9 +393,9 @@ void
CGlass::AskForObjectToBeRenderedInGlass(CEntity *entity)
{
#ifdef FIX_BUGS
- if ( NumGlassEntities < NUM_GLASSPANES )
+ if ( NumGlassEntities < NUM_GLASSENTITIES )
#else
- if ( NumGlassEntities < NUM_GLASSPANES-1 )
+ if ( NumGlassEntities < NUM_GLASSENTITIES-1 )
#endif
{
apEntitiesToBeRendered[NumGlassEntities++] = entity;
diff --git a/src/render/SpecialFX.cpp b/src/render/SpecialFX.cpp
index fa8379f0..08dfda35 100644
--- a/src/render/SpecialFX.cpp
+++ b/src/render/SpecialFX.cpp
@@ -209,7 +209,7 @@ CMotionBlurStreaks::Update(void)
{
int i;
for(i = 0; i < NUMMBLURSTREAKS; i++)
- if(aStreaks[i].m_id)
+ if(aStreaks[i].m_id != 0)
aStreaks[i].Update();
}
@@ -230,7 +230,7 @@ CMotionBlurStreaks::RegisterStreak(uintptr id, uint8 r, uint8 g, uint8 b, CVecto
}
}
// Find free slot
- for(i = 0; aStreaks[i].m_id; i++)
+ for(i = 0; aStreaks[i].m_id != 0; i++)
if(i == NUMMBLURSTREAKS-1)
return;
// Create a new streak
@@ -251,7 +251,7 @@ CMotionBlurStreaks::Render(void)
bool setRenderStates = false;
int i;
for(i = 0; i < NUMMBLURSTREAKS; i++)
- if(aStreaks[i].m_id){
+ if(aStreaks[i].m_id != 0){
if(!setRenderStates){
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
@@ -328,7 +328,7 @@ void CBulletTraces::Render(void)
RwIm3DVertexSetPos(&TraceVertices[4], sup.x + width.x, sup.y + width.y, sup.z + width.z);
RwIm3DVertexSetPos(&TraceVertices[5], sup.x - width.x, sup.y - width.y, sup.z - width.z);
LittleTest();
- if (RwIm3DTransform(TraceVertices, ARRAY_SIZE(TraceVertices), nil, 1)) {
+ if (RwIm3DTransform(TraceVertices, ARRAY_SIZE(TraceVertices), nil, rwIM3D_VERTEXUV)) {
RwIm3DRenderIndexedPrimitive(rwPRIMTYPETRILIST, TraceIndexList, ARRAY_SIZE(TraceIndexList));
RwIm3DEnd();
}
@@ -851,6 +851,22 @@ CBrightLights::Render(void)
TempBufferIndicesStored += 12*3;
break;
+ case BRIGHTLIGHT_FRONT_BIG:
+ case BRIGHTLIGHT_REAR_BIG:
+ for (j = 0; j < 8; j++) {
+ pos = BigCarHeadLightsSide[j] * aBrightLights[i].m_side +
+ BigCarHeadLightsUp[j] * aBrightLights[i].m_up +
+ BigCarHeadLightsFront[j] * aBrightLights[i].m_front +
+ aBrightLights[i].m_pos;
+ RwIm3DVertexSetRGBA(&TempBufferRenderVertices[TempBufferVerticesStored + j], r, g, b, a);
+ RwIm3DVertexSetPos(&TempBufferRenderVertices[TempBufferVerticesStored + j], pos.x, pos.y, pos.z);
+ }
+ for (j = 0; j < 12 * 3; j++)
+ TempBufferRenderIndexList[TempBufferIndicesStored + j] = CubeIndices[j] + TempBufferVerticesStored;
+ TempBufferVerticesStored += 8;
+ TempBufferIndicesStored += 12 * 3;
+ break;
+
case BRIGHTLIGHT_FRONT_TALL:
case BRIGHTLIGHT_REAR_TALL:
for(j = 0; j < 8; j++){
@@ -869,8 +885,8 @@ CBrightLights::Render(void)
case BRIGHTLIGHT_SIREN:
for(j = 0; j < 6; j++){
- pos = SirenLightsSide[j]*aBrightLights[i].m_side +
- SirenLightsUp[j]*aBrightLights[i].m_up +
+ pos = SirenLightsSide[j] * TheCamera.GetRight() +
+ SirenLightsUp[j] * TheCamera.GetUp() +
aBrightLights[i].m_pos;
RwIm3DVertexSetRGBA(&TempBufferRenderVertices[TempBufferVerticesStored+j], r, g, b, a);
RwIm3DVertexSetPos(&TempBufferRenderVertices[TempBufferVerticesStored+j], pos.x, pos.y, pos.z);
@@ -1067,11 +1083,8 @@ CMoneyMessage::Render()
CFont::SetPropOn();
CFont::SetBackgroundOff();
- float fScaleY = fDistY / 100.0f;
- if (fScaleY > MAX_SCALE) fScaleY = MAX_SCALE;
-
- float fScaleX = fDistX / 100.0f;
- if (fScaleX > MAX_SCALE) fScaleX = MAX_SCALE;
+ float fScaleY = Min(fDistY / 100.0f, MAX_SCALE);
+ float fScaleX = Min(fDistX / 100.0f, MAX_SCALE);
CFont::SetScale(fScaleX, fScaleY); // maybe use SCREEN_SCALE_X and SCREEN_SCALE_Y here?
CFont::SetCentreOn();
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index a613fff0..26a3a509 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -43,6 +43,7 @@
#define MAX_SUBSYSTEMS (16)
+// --MIAMI: file done
rw::EngineOpenParams openParams;
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index 149c9045..a10a1a92 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -53,6 +53,7 @@
#define MAX_SUBSYSTEMS (16)
+// --MIAMI: file done
static RwBool ForegroundApp = TRUE;
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 1316985d..395f3917 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -1,4 +1,4 @@
-#include "common.h"
+#include "common.h"
#include "main.h"
#include "General.h"
@@ -4635,7 +4635,6 @@ CAutomobile::ProcessOpenDoor(uint32 component, uint32 anim, float time)
case ANIM_CAR_ROLLDOOR_LOW:
ProcessDoorOpenCloseAnimation(this, component, door, time, 0.1f, 0.6f, 0.95f);
break;
- break;
case ANIM_CAR_GETOUT_LHS:
case ANIM_CAR_GETOUT_LOW_LHS:
case ANIM_CAR_GETOUT_RHS:
@@ -4649,6 +4648,7 @@ CAutomobile::ProcessOpenDoor(uint32 component, uint32 anim, float time)
case ANIM_CAR_PULLOUT_RHS:
case ANIM_CAR_PULLOUT_LOW_RHS:
OpenDoor(component, door, 1.0f);
+ break;
case ANIM_COACH_OPEN_L:
case ANIM_COACH_OPEN_R:
ProcessDoorOpenAnimation(this, component, door, time, 0.66f, 0.8f);
@@ -5349,7 +5349,7 @@ CAutomobile::SpawnFlyingComponent(int32 component, uint32 type)
obj->m_fElasticity = 0.1f;
obj->m_fBuoyancy = obj->m_fMass*GRAVITY/0.75f;
obj->ObjectCreatedBy = TEMP_OBJECT;
- obj->bIsStatic = false;
+ obj->SetIsStatic(false);
obj->bIsPickup = false;
obj->bUseVehicleColours = true;
obj->m_colour1 = m_currentColour1;
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index 8c9dd241..d727b1bc 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -893,7 +893,7 @@ CBoat::BlowUpCar(CEntity *culprit)
obj->m_fElasticity = 0.1f;
obj->m_fBuoyancy = obj->m_fMass*GRAVITY/0.75f;
obj->ObjectCreatedBy = TEMP_OBJECT;
- obj->bIsStatic = false;
+ obj->SetIsStatic(false);
obj->bIsPickup = false;
// life time
diff --git a/src/vehicles/Heli.cpp b/src/vehicles/Heli.cpp
index 2c2fb33c..d6a237e5 100644
--- a/src/vehicles/Heli.cpp
+++ b/src/vehicles/Heli.cpp
@@ -671,7 +671,7 @@ CHeli::SpawnFlyingComponent(int32 component)
obj->m_fElasticity = 0.1f;
obj->m_fBuoyancy = obj->m_fMass*GRAVITY/0.75f;
obj->ObjectCreatedBy = TEMP_OBJECT;
- obj->bIsStatic = false;
+ obj->SetIsStatic(false);
obj->bIsPickup = false;
// life time
diff --git a/src/weapons/BulletInfo.cpp b/src/weapons/BulletInfo.cpp
index 375a2ca9..13032300 100644
--- a/src/weapons/BulletInfo.cpp
+++ b/src/weapons/BulletInfo.cpp
@@ -205,13 +205,13 @@ void CBulletInfo::Update(void)
if (pHitEntity->IsObject()) {
CObject *pHitObject = (CObject*)pHitEntity;
if ( !pHitObject->bInfiniteMass && pHitObject->m_fCollisionDamageMultiplier < 99.9f) {
- bool notStatic = !pHitObject->IsStatic();
+ bool notStatic = !pHitObject->GetIsStatic();
if (notStatic && pHitObject->m_fUprootLimit <= 0.0f) {
pHitObject->bIsStatic = false;
pHitObject->AddToMovingList();
}
- notStatic = !pHitObject->IsStatic();
+ notStatic = !pHitObject->GetIsStatic();
if (!notStatic) {
CVector moveForce = point.normal * -BULLET_HIT_FORCE;
pHitObject->ApplyMoveForce(moveForce.x, moveForce.y, moveForce.z);
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index 48f90897..5d9686b5 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -1526,14 +1526,14 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim,
if ( !victimObject->bInfiniteMass && victimObject->m_fCollisionDamageMultiplier < 99.9f)
{
- bool notStatic = !victimObject->IsStatic();
+ bool notStatic = !victimObject->GetIsStatic();
if (notStatic && victimObject->m_fUprootLimit <= 0.0f)
{
- victimObject->bIsStatic = false;
+ victimObject->SetIsStatic(false);
victimObject->AddToMovingList();
}
- notStatic = !victimObject->IsStatic();
+ notStatic = !victimObject->GetIsStatic();
if (!notStatic)
{
CVector moveForce = point->normal * -4.0f;
@@ -1922,14 +1922,14 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
if ( !victimObject->bInfiniteMass )
{
- bool notStatic = !victimObject->IsStatic();
+ bool notStatic = !victimObject->GetIsStatic();
if ( notStatic && victimObject->m_fUprootLimit <= 0.0f )
{
- victimObject->bIsStatic = false;
+ victimObject->SetIsStatic(false);
victimObject->AddToMovingList();
}
- notStatic = !victimObject->IsStatic();
+ notStatic = !victimObject->GetIsStatic();
if ( !notStatic )
{
CVector moveForce = point.normal*-5.0f;
@@ -3149,9 +3149,9 @@ CWeapon::BlowUpExplosiveThings(CEntity *thing)
object->m_vecMoveSpeed.x += float((CGeneral::GetRandomNumber()&255) - 128) * 0.0002f;
object->m_vecMoveSpeed.y += float((CGeneral::GetRandomNumber()&255) - 128) * 0.0002f;
- if ( object->IsStatic())
+ if ( object->GetIsStatic())
{
- object->bIsStatic = false;
+ object->SetIsStatic(false);
object->AddToMovingList();
}
}