summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-12-05 22:59:42 +0000
committerbjarni <bjarni@openttd.org>2006-12-05 22:59:42 +0000
commit4adc6ba4f853d1b11994948f2653ddb618da36bb (patch)
tree7833c716fc42b444f89413faa48f18b9ce21ecea /train_cmd.c
parent686a0d7750405d10088a23732f33359728039aa5 (diff)
downloadopenttd-4adc6ba4f853d1b11994948f2653ddb618da36bb.tar.xz
(svn r7386) -Codechange r7385: moved deletion of the vehicle highlight from DeleteVehicle to the sell commands as they are not called as often
Also added a return to the window loop prevent looking at the rest of the windows once the right depot window is found
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 69ae01daa..a1792deb5 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -1373,6 +1373,7 @@ int32 CmdSellRailWagon(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
cost -= rear->value;
if (flags & DC_EXEC) {
UnlinkWagon(rear, first);
+ DeleteDepotHighlightOfVehicle(rear);
DeleteVehicle(rear);
}
}
@@ -1417,6 +1418,7 @@ int32 CmdSellRailWagon(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
cost -= v->value;
if (flags & DC_EXEC) {
first = UnlinkWagon(v, first);
+ DeleteDepotHighlightOfVehicle(v);
DeleteVehicle(v);
/* 4 If the second wagon was an engine, update it to front_engine
@@ -1463,6 +1465,7 @@ int32 CmdSellRailWagon(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
cost -= rear->value;
if (flags & DC_EXEC) {
first = UnlinkWagon(rear, first);
+ DeleteDepotHighlightOfVehicle(rear);
DeleteVehicle(rear);
}
}
@@ -1475,6 +1478,7 @@ int32 CmdSellRailWagon(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
cost -= v->value;
if (flags & DC_EXEC) {
first = UnlinkWagon(v, first);
+ DeleteDepotHighlightOfVehicle(v);
DeleteVehicle(v);
}
}