--- a/ship_cmd.c Mon Jan 17 22:44:33 2005 +0000
+++ b/ship_cmd.c Tue Jan 18 09:35:31 2005 +0000
@@ -21,19 +21,6 @@
return r | r >> 8;
}
-void InvalidateShipWindows(const Vehicle *v)
-{
- const Order *order;
-
- InvalidateWindow(WC_SHIPS_LIST, v->owner);
-
- FOR_VEHICLE_ORDERS(v, order) {
- if (order->type == OT_GOTO_STATION ) {
- InvalidateWindow(WC_SHIPS_LIST, (order->station << 16) | v->owner);
- }
- }
-}
-
void DrawShipEngine(int x, int y, int engine, uint32 image_ormod)
{
int spritenum = ShipVehInfo(engine)->image_index;
@@ -159,6 +146,8 @@
SubtractMoneyFromPlayerFract(v->owner, cost);
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
+ //we need this for the profit
+ InvalidateWindowClasses(WC_SHIPS_LIST);
}
static void HandleBrokenShip(Vehicle *v)
@@ -186,7 +175,7 @@
if (!(v->tick_counter & 1)) {
if (!--v->breakdown_delay) {
v->breakdown_ctr = 0;
- InvalidateShipWindows(v);
+ InvalidateWindowClasses(WC_SHIPS_LIST);
}
}
}
@@ -268,7 +257,7 @@
InvalidateVehicleOrder(v);
- InvalidateShipWindows(v);
+ InvalidateWindowClasses(WC_SHIPS_LIST);
}
static void HandleShipLoading(Vehicle *v)
@@ -370,6 +359,7 @@
PlayShipSound(v);
VehicleServiceInDepot(v);
+ InvalidateWindowClasses(WC_SHIPS_LIST);
}
static bool ShipAccelerate(Vehicle *v)
@@ -443,6 +433,7 @@
}
}
}
+ InvalidateWindowClasses(WC_SHIPS_LIST);
}
static void ShipArrivesAt(Vehicle *v, Station *st)
@@ -931,7 +922,7 @@
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
}
- InvalidateShipWindows(v);
+ InvalidateWindowClasses(WC_SHIPS_LIST);
return 0;
}