summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-26 21:08:51 +0000
committerrubidium <rubidium@openttd.org>2008-12-26 21:08:51 +0000
commit3ebe66a5e47531e9033c8552a1abe82ad0ef448f (patch)
treedbb2d01a3da0060c340d6e2adcfcf1188c8f3891 /src/train_cmd.cpp
parentf18043ee21218dc9ea26ce41b1294c5212ac363c (diff)
downloadopenttd-3ebe66a5e47531e9033c8552a1abe82ad0ef448f.tar.xz
(svn r14748) -Codechange: unduplicate window updating when deleting vehicles.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 619a3e8a4..40604b55b 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -1418,7 +1418,6 @@ CommandCost CmdSellRailWagon(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
cost.AddCost(-rear->value);
if (flags & DC_EXEC) {
UnlinkWagon(rear, first);
- DeleteDepotHighlightOfVehicle(rear);
delete rear;
}
}
@@ -1467,7 +1466,6 @@ CommandCost CmdSellRailWagon(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
cost.AddCost(-v->value);
if (flags & DC_EXEC) {
first = UnlinkWagon(v, first);
- DeleteDepotHighlightOfVehicle(v);
delete v;
/* 4 If the second wagon was an engine, update it to front_engine
@@ -1521,7 +1519,6 @@ CommandCost CmdSellRailWagon(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
first = UnlinkWagon(rear, first);
- DeleteDepotHighlightOfVehicle(rear);
delete rear;
}
}
@@ -1534,7 +1531,6 @@ CommandCost CmdSellRailWagon(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
cost.AddCost(-v->value);
if (flags & DC_EXEC) {
first = UnlinkWagon(v, first);
- DeleteDepotHighlightOfVehicle(v);
delete v;
}
}
@@ -3934,11 +3930,7 @@ static void DeleteLastWagon(Vehicle *v)
for (; v->Next() != NULL; v = v->Next()) u = v;
u->SetNext(NULL);
- if (first == v) {
- /* Removing front vehicle (the last to go) */
- DeleteWindowById(WC_VEHICLE_VIEW, v->index);
- InvalidateWindow(WC_COMPANY, v->owner);
- } else {
+ if (first != v) {
/* Recalculate cached train properties */
TrainConsistChanged(first, false);
/* Update the depot window if the first vehicle is in depot -
@@ -3948,10 +3940,6 @@ static void DeleteLastWagon(Vehicle *v)
}
}
- InvalidateWindowClassesData(WC_TRAINS_LIST, 0);
-
- MarkSingleVehicleDirty(v);
-
/* 'v' shouldn't be accessed after it has been deleted */
TrackBits trackbits = v->u.rail.track;
TileIndex tile = v->tile;