summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-07-20 21:23:28 +0000
committerpeter1138 <peter1138@openttd.org>2008-07-20 21:23:28 +0000
commite6a1f1c0127e4a0b93935fa2fcb178eb88b2be7a (patch)
tree84c167bb88682ca79d2739d81b1d98c85e1f387a /src
parent00e052ad39b6ce80809da279a1c7f4b66615a4ca (diff)
downloadopenttd-e6a1f1c0127e4a0b93935fa2fcb178eb88b2be7a.tar.xz
(svn r13761) -Codechange: Remove dependency on rail for altering purchase list position (mostly function renaming)
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp4
-rw-r--r--src/newgrf_engine.cpp6
-rw-r--r--src/newgrf_engine.h4
3 files changed, 7 insertions, 7 deletions
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<ListOrderChange> _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<uint16, Engine*> 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);