summaryrefslogtreecommitdiff
path: root/ship_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 /ship_gui.c
parentd0cdb45b6c634b4b7238f9b8b8cd9344cb7b1ac3 (diff)
downloadopenttd-fa8f46c0b7f4723c12ddefd77d619ca98b6c7c6c.tar.xz
(svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[]
Diffstat (limited to 'ship_gui.c')
-rw-r--r--ship_gui.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ship_gui.c b/ship_gui.c
index 0f9cba79a..5100d3805 100644
--- a/ship_gui.c
+++ b/ship_gui.c
@@ -44,7 +44,7 @@ void DrawShipPurchaseInfo(int x, int y, EngineID engine_number)
y += 10;
/* Design date - Life length */
- e = &_engines[engine_number];
+ e = GetEngine(engine_number);
ConvertDayToYMD(&ymd, e->intro_date);
SetDParam(0, ymd.year + 1920);
SetDParam(1, e->lifelength);
@@ -326,7 +326,8 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
{
int count = 0;
int num = NUM_SHIP_ENGINES;
- Engine *e = &_engines[SHIP_ENGINES_INDEX];
+ const Engine* e = GetEngine(SHIP_ENGINES_INDEX);
+
do {
if (HASBIT(e->player_avail, _local_player))
count++;
@@ -338,7 +339,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
{
int num = NUM_SHIP_ENGINES;
- Engine *e = &_engines[SHIP_ENGINES_INDEX];
+ const Engine* e = GetEngine(SHIP_ENGINES_INDEX);
int x = 2;
int y = 15;
int sel = WP(w,buildtrain_d).sel_index;