summaryrefslogtreecommitdiff
path: root/train_cmd.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
commitd2364f1d51ed868d6c9f0336c57dde46aef5fc3c (patch)
tree918dadd86e83f26d5de3c32831397bc35434bfa7 /train_cmd.c
parentf723540fbb69d32f1ca9d5487657f39e69efc239 (diff)
downloadopenttd-d2364f1d51ed868d6c9f0336c57dde46aef5fc3c.tar.xz
(svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[]
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/train_cmd.c b/train_cmd.c
index b12b49de6..547aedf88 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -481,7 +481,7 @@ static int32 CmdBuildRailWagon(uint engine, uint tile, uint32 flags)
v->value = value;
// v->day_counter = 0;
- e = &_engines[engine];
+ e = GetEngine(engine);
v->u.rail.railtype = e->railtype;
v->build_year = _cur_year;
@@ -650,7 +650,7 @@ int32 CmdBuildRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
v->dest_tile = 0;
v->engine_type = (byte)p1;
- e = DEREF_ENGINE(p1);
+ e = GetEngine(p1);
v->reliability = e->reliability;
v->reliability_spd_dec = e->reliability_spd_dec;
@@ -1693,9 +1693,9 @@ static void HandleLocomotiveSmokeCloud(Vehicle *v)
int engtype = v->engine_type;
// no smoke?
- if (RailVehInfo(engtype)->flags & 2
- || _engines[engtype].railtype > 0
- || (v->vehstatus&VS_HIDDEN) || (v->u.rail.track & 0xC0) )
+ if (RailVehInfo(engtype)->flags & 2 ||
+ GetEngine(engtype)->railtype > 0 ||
+ (v->vehstatus & VS_HIDDEN) || (v->u.rail.track & 0xC0))
continue;
switch (RailVehInfo(engtype)->engclass) {
@@ -1738,7 +1738,7 @@ static void TrainPlayLeaveStationSound(Vehicle *v)
int engtype = v->engine_type;
- switch (_engines[engtype].railtype) {
+ switch (GetEngine(engtype)->railtype) {
case 0:
SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], v);
break;