summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/roadveh_cmd.cpp4
-rw-r--r--src/train_cmd.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index d85203173..82a02305a 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -534,7 +534,7 @@ CommandCost CmdTurnRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (v->type != VEH_ROAD || !CheckOwnership(v->owner)) return CMD_ERROR;
if (v->vehstatus & VS_STOPPED ||
- v->u.road.crashed_ctr != 0 ||
+ v->vehstatus & VS_CRASHED ||
v->breakdown_ctr != 0 ||
v->u.road.overtaking != 0 ||
v->u.road.state == RVSB_WORMHOLE ||
@@ -1794,7 +1794,7 @@ static void RoadVehController(Vehicle *v)
if (v->u.road.reverse_ctr != 0) v->u.road.reverse_ctr--;
/* handle crashed */
- if (v->u.road.crashed_ctr != 0) {
+ if (v->vehstatus & VS_CRASHED) {
RoadVehIsCrashed(v);
return;
}
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;
}