summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-04 11:01:35 +0000
committertron <tron@openttd.org>2006-03-04 11:01:35 +0000
commit332b54d5a6156c192e044163d7f38d87e2801814 (patch)
tree2eef654bc6b8956ee2e2ff73c1a3f6e72b920031 /train_cmd.c
parentf383a038f0ac86706bcd976ec7a6e5e2de11b720 (diff)
downloadopenttd-332b54d5a6156c192e044163d7f38d87e2801814.tar.xz
(svn r3757) -Feature: Delete news items about vehicles, when they get stale
This is used to delete - all news about a vehicle, when it gets deleted - "vehicle has stopped in depot" news, when it gets started - "vehicle has invalid orders" news, when the orders get changed
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 4ab362821..cf2450bc2 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -1176,6 +1176,10 @@ int32 CmdStartStopTrain(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (v->type != VEH_Train || !CheckOwnership(v->owner)) return CMD_ERROR;
if (flags & DC_EXEC) {
+ if (v->vehstatus & VS_STOPPED && v->u.rail.track == 0x80) {
+ DeleteVehicleNews(p1, STR_8814_TRAIN_IS_WAITING_IN_DEPOT);
+ }
+
v->u.rail.days_since_order_progr = 0;
v->vehstatus ^= VS_STOPPED;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);