summaryrefslogtreecommitdiff
path: root/src/ship_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r--src/ship_cmd.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 03c2efbb4..e95a660ec 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -888,13 +888,14 @@ int32 CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
v->random_bits = VehicleRandomBits();
VehiclePositionChanged(v);
- GetPlayer(_current_player)->num_engines[p1]++;
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
RebuildVehicleLists();
InvalidateWindow(WC_COMPANY, v->owner);
if (IsLocalPlayer())
- InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Ship); // updates the replace Ship window
+ InvalidateAutoreplaceWindow(VEH_Ship); // updates the replace Ship window
+
+ GetPlayer(_current_player)->num_engines[p1]++;
}
return value;
@@ -928,8 +929,6 @@ int32 CmdSellShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
DeleteWindowById(WC_VEHICLE_VIEW, v->index);
DeleteDepotHighlightOfVehicle(v);
DeleteVehicle(v);
- if (IsLocalPlayer())
- InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Ship); // updates the replace Ship window
}
return -(int32)v->value;