summaryrefslogtreecommitdiffstats
path: root/src/vehicles
diff options
context:
space:
mode:
authorRoman Masanin <36927roma@gmail.com>2020-10-24 13:20:08 +0200
committerRoman Masanin <36927roma@gmail.com>2020-10-24 13:20:08 +0200
commit39b7075502b91172e557ec17932dfd68c7da96a1 (patch)
tree681194f8c652968c3e525d7c10c25d35e04d499b /src/vehicles
parentpeds (diff)
parentmore ScriptSounds (diff)
downloadre3-39b7075502b91172e557ec17932dfd68c7da96a1.tar
re3-39b7075502b91172e557ec17932dfd68c7da96a1.tar.gz
re3-39b7075502b91172e557ec17932dfd68c7da96a1.tar.bz2
re3-39b7075502b91172e557ec17932dfd68c7da96a1.tar.lz
re3-39b7075502b91172e557ec17932dfd68c7da96a1.tar.xz
re3-39b7075502b91172e557ec17932dfd68c7da96a1.tar.zst
re3-39b7075502b91172e557ec17932dfd68c7da96a1.zip
Diffstat (limited to '')
-rw-r--r--src/vehicles/Automobile.cpp12
-rw-r--r--src/vehicles/Bike.cpp24
-rw-r--r--src/vehicles/Bike.h6
-rw-r--r--src/vehicles/Boat.cpp8
-rw-r--r--src/vehicles/CarGen.cpp2
-rw-r--r--src/vehicles/Cranes.cpp10
-rw-r--r--src/vehicles/Cranes.h1
-rw-r--r--src/vehicles/Heli.cpp2
-rw-r--r--src/vehicles/Train.cpp2
-rw-r--r--src/vehicles/Vehicle.cpp20
10 files changed, 56 insertions, 31 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 1316985d..d1a7505e 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"
@@ -59,7 +59,7 @@ bool CAutomobile::m_sAllTaxiLights;
const uint32 CAutomobile::nSaveStructSize =
#ifdef COMPATIBLE_SAVES
- 1448;
+ 1500;
#else
sizeof(CAutomobile);
#endif
@@ -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;
@@ -5713,7 +5713,7 @@ CAutomobile::Save(uint8*& buf)
{
CVehicle::Save(buf);
WriteSaveBuf<CDamageManager>(buf, Damage);
- SkipSaveBuf(buf, 800 - sizeof(CDamageManager));
+ SkipSaveBuf(buf, 1500 - 672 - sizeof(CDamageManager));
}
void
@@ -5721,7 +5721,7 @@ CAutomobile::Load(uint8*& buf)
{
CVehicle::Load(buf);
Damage = ReadSaveBuf<CDamageManager>(buf);
- SkipSaveBuf(buf, 800 - sizeof(CDamageManager));
+ SkipSaveBuf(buf, 1500 - 672 - sizeof(CDamageManager));
SetupDamageAfterLoad();
}
#endif
diff --git a/src/vehicles/Bike.cpp b/src/vehicles/Bike.cpp
index b5bc9480..4a4b0516 100644
--- a/src/vehicles/Bike.cpp
+++ b/src/vehicles/Bike.cpp
@@ -39,6 +39,14 @@
//--MIAMI: file done
+const uint32 CBike::nSaveStructSize =
+#ifdef COMPATIBLE_SAVES
+ 1260;
+#else
+ sizeof(CBoat);
+#endif
+
+
// TODO: maybe put this somewhere else
inline void
GetRelativeMatrix(RwMatrix *mat, RwFrame *frm, RwFrame *end)
@@ -2922,3 +2930,19 @@ CBike::ReduceHornCounter(void)
if(m_nCarHornTimer != 0)
m_nCarHornTimer--;
}
+
+#ifdef COMPATIBLE_SAVES
+void
+CBike::Save(uint8*& buf)
+{
+ CVehicle::Save(buf);
+ SkipSaveBuf(buf, 1260 - 672);
+}
+
+void
+CBike::Load(uint8*& buf)
+{
+ CVehicle::Load(buf);
+ SkipSaveBuf(buf, 1260 - 672);
+}
+#endif
diff --git a/src/vehicles/Bike.h b/src/vehicles/Bike.h
index 885fe1b0..3fcf66a2 100644
--- a/src/vehicles/Bike.h
+++ b/src/vehicles/Bike.h
@@ -132,6 +132,12 @@ public:
void Fix(void);
void SetupModelNodes(void);
void ReduceHornCounter(void);
+
+#ifdef COMPATIBLE_SAVES
+ virtual void Save(uint8*& buf);
+ virtual void Load(uint8*& buf);
+#endif
+ static const uint32 nSaveStructSize;
};
// These functions and function names are made up
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index 8c9dd241..8b5de929 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -43,7 +43,7 @@ CBoat *CBoat::apFrameWakeGeneratingBoats[4];
const uint32 CBoat::nSaveStructSize =
#ifdef COMPATIBLE_SAVES
- 1156;
+ 1216;
#else
sizeof(CBoat);
#endif
@@ -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
@@ -1449,13 +1449,13 @@ void
CBoat::Save(uint8*& buf)
{
CVehicle::Save(buf);
- SkipSaveBuf(buf, 1156 - 648);
+ SkipSaveBuf(buf, 1216 - 672);
}
void
CBoat::Load(uint8*& buf)
{
CVehicle::Load(buf);
- SkipSaveBuf(buf, 1156 - 648);
+ SkipSaveBuf(buf, 1216 - 672);
}
#endif
diff --git a/src/vehicles/CarGen.cpp b/src/vehicles/CarGen.cpp
index 598b8342..77d66cbf 100644
--- a/src/vehicles/CarGen.cpp
+++ b/src/vehicles/CarGen.cpp
@@ -91,7 +91,7 @@ void CCarGenerator::DoInternalProcessing()
pVehicle = pBoat;
if (pos.z <= -100.0f)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
- pBoat->bExtendedRange = false;
+ pBoat->bExtendedRange = true;
}else{
bool groundFound;
pos = m_vecPos;
diff --git a/src/vehicles/Cranes.cpp b/src/vehicles/Cranes.cpp
index 1ab31574..2a571a67 100644
--- a/src/vehicles/Cranes.cpp
+++ b/src/vehicles/Cranes.cpp
@@ -12,6 +12,8 @@
#include "Object.h"
#include "World.h"
+// --MIAMI: file done
+
#define MAX_DISTANCE_TO_FIND_CRANE (10.0f)
#define CRANE_UPDATE_RADIUS (300.0f)
#define CRANE_MOVEMENT_PROCESSING_RADIUS (150.0f)
@@ -259,7 +261,6 @@ void CCrane::Update(void)
m_pVehiclePickedUp->bUsesCollision = false;
if (m_bIsCrusher)
m_pVehiclePickedUp->bCollisionProof = true;
- DMAudio.PlayOneShot(m_nAudioEntity, SOUND_CRANE_PICKUP, 0.0f);
}
}
}
@@ -439,8 +440,6 @@ bool CCrane::DoesCranePickUpThisCarType(uint32 mi)
mi != MI_TRASH &&
#ifdef FIX_BUGS
mi != MI_COACH &&
-#else
- mi != MI_BLISTA &&
#endif
mi != MI_SECURICA &&
mi != MI_BUS &&
@@ -657,11 +656,6 @@ void CCranes::Load(uint8* buf, uint32 size)
if (pCrane->m_pVehiclePickedUp != nil)
pCrane->m_pVehiclePickedUp = CPools::GetVehiclePool()->GetSlot((uintptr)pCrane->m_pVehiclePickedUp - 1);
}
- /*for (int i = 0; i < NUM_CRANES; i++) {
- aCranes[i].m_nAudioEntity = DMAudio.CreateEntity(AUDIOTYPE_CRANE, &aCranes[i]);
- if (aCranes[i].m_nAudioEntity != 0)
- DMAudio.SetEntityStatus(aCranes[i].m_nAudioEntity, 1);
- }*/
VALIDATESAVEBUF(size);
}
diff --git a/src/vehicles/Cranes.h b/src/vehicles/Cranes.h
index 6d877d82..45ea7a8d 100644
--- a/src/vehicles/Cranes.h
+++ b/src/vehicles/Cranes.h
@@ -26,7 +26,6 @@ public:
};
CBuilding *m_pCraneEntity;
CObject *m_pHook;
- int32 m_nAudioEntity;
float m_fPickupX1;
float m_fPickupX2;
float m_fPickupY1;
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/vehicles/Train.cpp b/src/vehicles/Train.cpp
index 546f72c2..fb8361c5 100644
--- a/src/vehicles/Train.cpp
+++ b/src/vehicles/Train.cpp
@@ -663,6 +663,7 @@ PlayAnnouncement(uint8 sound, uint8 station)
void
ProcessTrainAnnouncements(void)
{
+#ifdef GTA_TRAIN
for (int i = 0; i < ARRAY_SIZE(StationDist); i++) {
for (int j = 0; j < ARRAY_SIZE(EngineTrackPosition); j++) {
if (!bTrainArrivalAnnounced[i]) {
@@ -691,6 +692,7 @@ ProcessTrainAnnouncements(void)
}
}
}
+#endif
}
void
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp
index 994f3c99..cba465b7 100644
--- a/src/vehicles/Vehicle.cpp
+++ b/src/vehicles/Vehicle.cpp
@@ -2367,15 +2367,15 @@ CVehicle::Save(uint8*& buf)
WriteSaveBuf<float>(buf, GetPosition().z);
SkipSaveBuf(buf, 16);
SaveEntityFlags(buf);
- SkipSaveBuf(buf, 212);
+ SkipSaveBuf(buf, 208);
AutoPilot.Save(buf);
WriteSaveBuf<int8>(buf, m_currentColour1);
WriteSaveBuf<int8>(buf, m_currentColour2);
SkipSaveBuf(buf, 2);
WriteSaveBuf<int16>(buf, m_nAlarmState);
- SkipSaveBuf(buf, 43);
+ SkipSaveBuf(buf, 42);
WriteSaveBuf<uint8>(buf, m_nNumMaxPassengers);
- SkipSaveBuf(buf, 2);
+ SkipSaveBuf(buf, 3);
WriteSaveBuf<float>(buf, field_1D0[0]);
WriteSaveBuf<float>(buf, field_1D0[1]);
WriteSaveBuf<float>(buf, field_1D0[2]);
@@ -2398,13 +2398,13 @@ CVehicle::Save(uint8*& buf)
WriteSaveBuf<uint8>(buf, m_nCurrentGear);
SkipSaveBuf(buf, 3);
WriteSaveBuf<float>(buf, m_fChangeGearTime);
- SkipSaveBuf(buf, 4);
+ SkipSaveBuf(buf, 12);
WriteSaveBuf<uint32>(buf, m_nTimeOfDeath);
SkipSaveBuf(buf, 2);
WriteSaveBuf<int16>(buf, m_nBombTimer);
SkipSaveBuf(buf, 12);
WriteSaveBuf<int8>(buf, m_nDoorLock);
- SkipSaveBuf(buf, 99);
+ SkipSaveBuf(buf, 111);
}
void
@@ -2430,15 +2430,15 @@ CVehicle::Load(uint8*& buf)
m_matrix = tmp;
SkipSaveBuf(buf, 16);
LoadEntityFlags(buf);
- SkipSaveBuf(buf, 212);
+ SkipSaveBuf(buf, 208);
AutoPilot.Load(buf);
m_currentColour1 = ReadSaveBuf<int8>(buf);
m_currentColour2 = ReadSaveBuf<int8>(buf);
SkipSaveBuf(buf, 2);
m_nAlarmState = ReadSaveBuf<int16>(buf);
- SkipSaveBuf(buf, 43);
+ SkipSaveBuf(buf, 42);
m_nNumMaxPassengers = ReadSaveBuf<int8>(buf);
- SkipSaveBuf(buf, 2);
+ SkipSaveBuf(buf, 3);
field_1D0[0] = ReadSaveBuf<float>(buf);
field_1D0[1] = ReadSaveBuf<float>(buf);
field_1D0[2] = ReadSaveBuf<float>(buf);
@@ -2460,13 +2460,13 @@ CVehicle::Load(uint8*& buf)
m_nCurrentGear = ReadSaveBuf<uint8>(buf);
SkipSaveBuf(buf, 3);
m_fChangeGearTime = ReadSaveBuf<float>(buf);
- SkipSaveBuf(buf, 4);
+ SkipSaveBuf(buf, 12);
m_nTimeOfDeath = ReadSaveBuf<uint32>(buf);
SkipSaveBuf(buf, 2);
m_nBombTimer = ReadSaveBuf<int16>(buf);
SkipSaveBuf(buf, 12);
m_nDoorLock = (eCarLock)ReadSaveBuf<int8>(buf);
- SkipSaveBuf(buf, 99);
+ SkipSaveBuf(buf, 111);
}
#endif