diff options
author | celestar <celestar@openttd.org> | 2007-01-17 11:15:51 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2007-01-17 11:15:51 +0000 |
commit | 8c547930686ae662b26dbe93362c05e6e4227ac1 (patch) | |
tree | 3335268e36d18ec8067bc2aac90872caadf1709a /src/oldloader.cpp | |
parent | a973e457193b41afbfaa468be1c2fe22c484c845 (diff) | |
download | openttd-8c547930686ae662b26dbe93362c05e6e4227ac1.tar.xz |
(svn r8185) -Codechange: Equipped Roadstops with new/delete operators and gave them proper constructors/destructors (Thanks to KUDr for a nice interactive C++ lesson)
Diffstat (limited to 'src/oldloader.cpp')
-rw-r--r-- | src/oldloader.cpp | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/oldloader.cpp b/src/oldloader.cpp index 58f82cf14..d2e67a1b5 100644 --- a/src/oldloader.cpp +++ b/src/oldloader.cpp @@ -314,27 +314,10 @@ static void FixOldStations(void) } /* Check if there is a bus or truck station, and convert to new format */ - if (st->bus_tile_obsolete != 0) { - st->bus_stops = AllocateRoadStop(); - st->bus_stops->xy = st->bus_tile_obsolete; - st->bus_stops->used = true; - st->bus_stops->status = 3; - st->bus_stops->station = st->index; - st->bus_stops->next = NULL; - st->bus_stops->prev = NULL; - st->bus_stops->num_vehicles = 0; - } + if (st->bus_tile_obsolete != 0) st->bus_stops = new RoadStop(st->bus_tile_obsolete, st->index); + + if (st->lorry_tile_obsolete != 0) st->truck_stops = new RoadStop(st->lorry_tile_obsolete, st->index); - if (st->lorry_tile_obsolete != 0) { - st->truck_stops = AllocateRoadStop(); - st->truck_stops->xy = st->lorry_tile_obsolete; - st->truck_stops->used = true; - st->truck_stops->status = 3; - st->truck_stops->station = st->index; - st->truck_stops->next = NULL; - st->truck_stops->prev = NULL; - st->truck_stops->num_vehicles = 0; - } } } |