diff options
| author | MegaMech <inkstudios1@hotmail.com> | 2024-12-29 23:57:26 -0700 |
|---|---|---|
| committer | MegaMech <inkstudios1@hotmail.com> | 2024-12-29 23:57:26 -0700 |
| commit | 2bd41c6d90995cff7387e11374843cbe9e62b10f (patch) | |
| tree | c431d7aaa840e6277d53dc54c8f1edb7408e3bb0 /src/engine/vehicles/Train.cpp | |
| parent | 08e4bf37979131e76e617beafb3f5ca6286e5ebb (diff) | |
Fix Seagull, classes count their own instances --> cleanup
Diffstat (limited to 'src/engine/vehicles/Train.cpp')
| -rw-r--r-- | src/engine/vehicles/Train.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/engine/vehicles/Train.cpp b/src/engine/vehicles/Train.cpp index c34ac1cf3..0e9af21ed 100644 --- a/src/engine/vehicles/Train.cpp +++ b/src/engine/vehicles/Train.cpp @@ -22,12 +22,14 @@ extern "C" { // #include "common_structs.h" } -ATrain::ATrain(size_t idx, ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint32_t waypoint) { +size_t ATrain::_count = 0; + +ATrain::ATrain(ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint32_t waypoint) { u16 waypointOffset; TrainCarStuff* ptr1; Path2D* pos; - Index = idx; + Index = _count; Speed = speed; // Set to the default value @@ -73,6 +75,8 @@ ATrain::ATrain(size_t idx, ATrain::TenderStatus tender, size_t numCarriages, f32 NumCars = NUM_TENDERS + numCarriages; AnotherSmokeTimer = 0; + + _count++; } void ATrain::Spawn() { |
