mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-21 13:39:09 +00:00
(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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user