summaryrefslogtreecommitdiff
path: root/vehicle_gui.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-03-31 12:59:43 +0000
committerpeter1138 <peter1138@openttd.org>2006-03-31 12:59:43 +0000
commiteb1568835815a10e4dde51c3067775feb4ca7930 (patch)
tree3f9c7926897f63e5f92550c9c7802e07ec3a2f67 /vehicle_gui.c
parent113b093d89b9a467769ea8d1f7d7d39e91846f15 (diff)
downloadopenttd-eb1568835815a10e4dde51c3067775feb4ca7930.tar.xz
(svn r4201) - Codechange: Do for _engine_info[] what we do for _*_vehicle_info[]; create and use a function to retrieve data, and ensure constness.
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r--vehicle_gui.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c
index 31b8e9bf0..7e92c5147 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -233,7 +233,7 @@ CargoID DrawVehicleRefitWindow(const Vehicle *v, int sel)
* it with the bitmask of available cargo on the current landscape, and
* where the bits are set: those are available */
do {
- cmask |= _engine_info[u->engine_type].refit_mask;
+ cmask |= EngInfo(u->engine_type)->refit_mask;
u = u->next;
} while (v->type == VEH_Train && u != NULL);
@@ -461,7 +461,7 @@ static void train_engine_drawing_loop(int *x, int *y, int *pos, int *sel, Engine
EngineID i = GetRailVehAtPosition(j);
const Engine *e = GetEngine(i);
const RailVehicleInfo *rvi = RailVehInfo(i);
- const EngineInfo *info = &_engine_info[i];
+ const EngineInfo *info = EngInfo(i);
if (!EngineHasReplacementForPlayer(p, i) && _player_num_engines[i] == 0 && show_outdated) continue;
@@ -523,7 +523,7 @@ static void SetupScrollStuffForReplaceWindow(Window *w)
for (i = 0; i < NUM_TRAIN_ENGINES; i++) {
EngineID eid = GetRailVehAtPosition(i);
const Engine* e = GetEngine(eid);
- const EngineInfo* info = &_engine_info[eid];
+ const EngineInfo* info = EngInfo(eid);
// left window contains compatible engines while right window only contains engines of the selected type
if (ENGINE_AVAILABLE && (