summaryrefslogtreecommitdiffstats
path: root/src/vehicles
diff options
context:
space:
mode:
authorMichael <60937741+majesticCoding@users.noreply.github.com>2021-01-09 16:36:44 +0100
committerGitHub <noreply@github.com>2021-01-09 16:36:44 +0100
commit5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3 (patch)
tree672024c0e3bf8cc3e0b96a89d6bed0680ab5284c /src/vehicles
parentAllocator fix (diff)
parentMerge remote-tracking branch 'upstream/lcs' into lcs (diff)
downloadre3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar.gz
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar.bz2
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar.lz
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar.xz
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar.zst
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.zip
Diffstat (limited to '')
-rw-r--r--src/vehicles/Automobile.cpp8
-rw-r--r--src/vehicles/Train.cpp58
2 files changed, 9 insertions, 57 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 028cd9cd..6db4313d 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -1641,13 +1641,13 @@ CAutomobile::ProcessControl(void)
// TODO: make the numbers defines
float heading;
- if(GetPosition().x > 1950.0f-400.0f){
+ if(GetPosition().x > 1950.0f){
if(m_vecMoveSpeed.x > 0.0f)
m_vecMoveSpeed.x *= -1.0f;
heading = GetForward().Heading();
if(heading > 0.0f) // going west
SetHeading(-heading);
- }else if(GetPosition().x < -1950.0f-400.0f){
+ }else if(GetPosition().x < -1950.0f){
if(m_vecMoveSpeed.x < 0.0f)
m_vecMoveSpeed.x *= -1.0f;
heading = GetForward().Heading();
@@ -5615,7 +5615,7 @@ CAutomobile::SetBumperDamage(int32 component, ePanels panel, bool noFlyingCompon
int status = Damage.GetPanelStatus(panel);
if(m_aCarNodes[component] == nil){
printf("Trying to damage component %d of %s\n",
- component, CModelInfo::GetModelInfo(GetModelIndex())->GetName());
+ component, CModelInfo::GetModelInfo(GetModelIndex())->GetModelName());
return;
}
if(status == PANEL_STATUS_SMASHED1){
@@ -5635,7 +5635,7 @@ CAutomobile::SetDoorDamage(int32 component, eDoors door, bool noFlyingComponents
int status = Damage.GetDoorStatus(door);
if(m_aCarNodes[component] == nil){
printf("Trying to damage component %d of %s\n",
- component, CModelInfo::GetModelInfo(GetModelIndex())->GetName());
+ component, CModelInfo::GetModelInfo(GetModelIndex())->GetModelName());
return;
}
diff --git a/src/vehicles/Train.cpp b/src/vehicles/Train.cpp
index 1a4af307..fefe1781 100644
--- a/src/vehicles/Train.cpp
+++ b/src/vehicles/Train.cpp
@@ -459,11 +459,11 @@ CTrain::InitTrains(void)
CStreaming::LoadAllRequestedModels(false);
// El-Train wagons
- float wagonPositions[] = { 0.0f, 20.0f, 40.0f, 0.0f, 20.0f };
- int8 firstWagon[] = { 1, 0, 0, 1, 0 };
- int8 lastWagon[] = { 0, 0, 1, 0, 1 };
- int16 wagonGroup[] = { 0, 0, 0, 1, 1 };
- for(i = 0; i < 5; i++){
+ float wagonPositions[] = { 0.0f, 20.0f, 0.0f, 20.0f };
+ int8 firstWagon[] = { 1, 0, 1, 0 };
+ int8 lastWagon[] = { 0, 1, 0, 1 };
+ int16 wagonGroup[] = { 0, 0, 1, 1 };
+ for(i = 0; i < 4; i++){
train = new CTrain(MI_TRAIN, PERMANENT_VEHICLE);
train->GetMatrix().SetTranslate(0.0f, 0.0f, 0.0f);
train->SetStatus(STATUS_ABANDONED);
@@ -650,52 +650,6 @@ CTrain::ReadAndInterpretTrackFile(Const char *filename, CTrainNode **nodes, int1
}
void
-PlayAnnouncement(uint8 sound, uint8 station)
-{
- // this was gone in a PC version but inlined on PS2
- cAudioScriptObject *obj = new cAudioScriptObject;
- obj->AudioId = sound;
- obj->Posn = CTrain::aStationCoors[station];
- obj->AudioEntity = AEHANDLE_NONE;
- DMAudio.CreateOneShotScriptObject(obj);
-}
-
-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]) {
- float preDist = StationDist[i] - 100.0f;
- if (preDist < 0.0f)
- preDist += TotalLengthOfTrack;
- if (EngineTrackPosition[j] > preDist && EngineTrackPosition[j] < StationDist[i]) {
- bTrainArrivalAnnounced[i] = true;
- PlayAnnouncement(SCRIPT_SOUND_TRAIN_ANNOUNCEMENT_1, i);
- break;
- }
- } else {
- float postDist = StationDist[i] + 10.0f;
-#ifdef FIX_BUGS
- if (postDist > TotalLengthOfTrack)
- postDist -= TotalLengthOfTrack;
-#else
- if (postDist < 0.0f) // does this even make sense here?
- postDist += TotalLengthOfTrack;
-#endif
- if (EngineTrackPosition[j] > StationDist[i] && EngineTrackPosition[j] < postDist) {
- bTrainArrivalAnnounced[i] = false;
- PlayAnnouncement(SCRIPT_SOUND_TRAIN_ANNOUNCEMENT_2, i);
- break;
- }
- }
- }
- }
-#endif
-}
-
-void
CTrain::UpdateTrains(void)
{
#ifdef GTA_TRAIN
@@ -732,8 +686,6 @@ CTrain::UpdateTrains(void)
// time offset for each train
time += 0x20000/2;
}
-
- ProcessTrainAnnouncements();
}
// Update Subway