diff options
author | rubidium <rubidium@openttd.org> | 2007-08-26 20:16:02 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-26 20:16:02 +0000 |
commit | a83ccad6bd289715da504f9ab514ac781ece5608 (patch) | |
tree | 37a1204079f8b5a2a2c336756f4f8e105bc4e95a /src/train_cmd.cpp | |
parent | cf1d74b41ed5652a07cca7bb666fcba30a2c2549 (diff) | |
download | openttd-a83ccad6bd289715da504f9ab514ac781ece5608.tar.xz |
(svn r10983) -Codechange: use vehstatus & VS_CRASHED instead of some other "methods" custom to each vehicle to determine whether the vehicle is crashed.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index d604d633d..f399fae58 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1645,8 +1645,8 @@ CommandCost CmdReverseTrainDirection(TileIndex tile, uint32 flags, uint32 p1, ui InvalidateWindow(WC_VEHICLE_DETAILS, v->index); } } else { - /*turn the whole train around */ - if (v->u.rail.crash_anim_pos != 0 || v->breakdown_ctr != 0) return CMD_ERROR; + /* turn the whole train around */ + if (v->vehstatus & VS_CRASHED || v->breakdown_ctr != 0) return CMD_ERROR; if (flags & DC_EXEC) { if (_patches.realistic_acceleration && v->cur_speed != 0) { @@ -3255,7 +3255,7 @@ static bool TrainCheckIfLineEnds(Vehicle *v) static void TrainLocoHandler(Vehicle *v, bool mode) { /* train has crashed? */ - if (v->u.rail.crash_anim_pos != 0) { + if (v->vehstatus & VS_CRASHED) { if (!mode) HandleCrashedTrain(v); return; } |