diff options
author | tron <tron@openttd.org> | 2005-06-07 18:13:49 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-06-07 18:13:49 +0000 |
commit | fa8f46c0b7f4723c12ddefd77d619ca98b6c7c6c (patch) | |
tree | 918dadd86e83f26d5de3c32831397bc35434bfa7 /train_cmd.c | |
parent | d0cdb45b6c634b4b7238f9b8b8cd9344cb7b1ac3 (diff) | |
download | openttd-fa8f46c0b7f4723c12ddefd77d619ca98b6c7c6c.tar.xz |
(svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[]
Diffstat (limited to 'train_cmd.c')
-rw-r--r-- | train_cmd.c | 12 |
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; |