summaryrefslogtreecommitdiff
path: root/roadveh_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-06-07 18:13:49 +0000
committertron <tron@openttd.org>2005-06-07 18:13:49 +0000
commitfa8f46c0b7f4723c12ddefd77d619ca98b6c7c6c (patch)
tree918dadd86e83f26d5de3c32831397bc35434bfa7 /roadveh_gui.c
parentd0cdb45b6c634b4b7238f9b8b8cd9344cb7b1ac3 (diff)
downloadopenttd-fa8f46c0b7f4723c12ddefd77d619ca98b6c7c6c.tar.xz
(svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[]
Diffstat (limited to 'roadveh_gui.c')
-rw-r--r--roadveh_gui.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/roadveh_gui.c b/roadveh_gui.c
index fbfa87967..019c87d67 100644
--- a/roadveh_gui.c
+++ b/roadveh_gui.c
@@ -23,7 +23,7 @@
void DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number)
{
const RoadVehicleInfo *rvi = RoadVehInfo(engine_number);
- Engine *e = &_engines[engine_number];
+ const Engine* e = GetEngine(engine_number);
YearMonthDay ymd;
ConvertDayToYMD(&ymd, e->intro_date);
@@ -370,7 +370,8 @@ static void DrawNewRoadVehWindow(Window *w)
{
int count = 0;
int num = NUM_ROAD_ENGINES;
- Engine *e = &_engines[ROAD_ENGINES_INDEX];
+ const Engine* e = GetEngine(ROAD_ENGINES_INDEX);
+
do {
if (HASBIT(e->player_avail, _local_player))
count++;
@@ -382,7 +383,7 @@ static void DrawNewRoadVehWindow(Window *w)
{
int num = NUM_ROAD_ENGINES;
- Engine *e = &_engines[ROAD_ENGINES_INDEX];
+ const Engine* e = GetEngine(ROAD_ENGINES_INDEX);
int x = 1;
int y = 15;
int sel = WP(w,buildtrain_d).sel_index;