From f81b3b7357bf6592a387b71f1d1323e7402da028 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 20 Jul 2008 21:23:28 +0000 Subject: (svn r13761) -Codechange: Remove dependency on rail for altering purchase list position (mostly function renaming) --- src/newgrf.cpp | 4 ++-- src/newgrf_engine.cpp | 6 +++--- src/newgrf_engine.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 07298be3e..634fd9a7a 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -584,7 +584,7 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf } break; case 0x1A: // Alter purchase list sort order - AlterRailVehListOrder(e->index, grf_load_byte(&buf)); + AlterVehicleListOrder(e->index, grf_load_byte(&buf)); break; case 0x1B: // Powered wagons power bonus @@ -6002,7 +6002,7 @@ static void AfterLoadGRFs() InitGRFTownGeneratorNames(); /* Run all queued vehicle list order changes */ - CommitRailVehListOrderChanges(); + CommitVehicleListOrderChanges(); /* Load old shore sprites in new position, if they were replaced by ActionA */ ActivateOldShore(); diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index b966de633..b5f2ceb4b 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1093,7 +1093,7 @@ struct ListOrderChange { static std::list _list_order_changes; -void AlterRailVehListOrder(EngineID engine, EngineID target) +void AlterVehicleListOrder(EngineID engine, EngineID target) { /* Add the list order change to a queue */ ListOrderChange loc; @@ -1102,7 +1102,7 @@ void AlterRailVehListOrder(EngineID engine, EngineID target) _list_order_changes.push_back(loc); } -void CommitRailVehListOrderChanges() +void CommitVehicleListOrderChanges() { /* List position to Engine map */ typedef std::map ListPositionMap; @@ -1120,7 +1120,7 @@ void CommitRailVehListOrderChanges() /* Populate map with current list positions */ Engine *e; - FOR_ALL_ENGINES_OF_TYPE(e, VEH_TRAIN) { + FOR_ALL_ENGINES_OF_TYPE(e, source_e->type) { if (!_settings_game.vehicle.dynamic_engines || e->grffile == source_e->grffile) { if (e->internal_id == target) target_e = e; lptr_map[e->list_position] = e; diff --git a/src/newgrf_engine.h b/src/newgrf_engine.h index 6beb6b0da..013fc4c7f 100644 --- a/src/newgrf_engine.h +++ b/src/newgrf_engine.h @@ -56,8 +56,8 @@ void TriggerVehicle(Vehicle *veh, VehicleTrigger trigger); void UnloadWagonOverrides(Engine *e); uint ListPositionOfEngine(EngineID engine); -void AlterRailVehListOrder(EngineID engine, EngineID target); -void CommitRailVehListOrderChanges(); +void AlterVehicleListOrder(EngineID engine, EngineID target); +void CommitVehicleListOrderChanges(); EngineID GetNewEngineID(const GRFFile *file, VehicleType type, uint16 internal_id); -- cgit v1.2.3-70-g09d2