(svn r6442) -Fix: ship depots windows now only draws the ships inside the depot instead of all ships in the depot tile
authorbjarni
Mon, 11 Sep 2006 20:38:35 +0000
changeset 4592 bf73e9641ff6
parent 4591 2991bc80a772
child 4593 d15fd72b57d6
(svn r6442) -Fix: ship depots windows now only draws the ships inside the depot instead of all ships in the depot tile
This bug was visible when a ship left. The window redraw was called, but it still saw the ship since it didn't leave the tile yet and it left a ghost in the depot window
ship_gui.c
--- a/ship_gui.c	Mon Sep 11 18:35:39 2006 +0000
+++ b/ship_gui.c	Mon Sep 11 20:38:35 2006 +0000
@@ -620,7 +620,7 @@
 	/* determine amount of items for scroller */
 	num = 0;
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Ship && (v) && v->tile == tile) num++;
+		if (v->type == VEH_Ship && IsShipInDepot(v) && v->tile == tile) num++;
 	}
 	SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
 
@@ -636,7 +636,7 @@
 	num = w->vscroll.pos * w->hscroll.cap;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Ship && (v) && v->tile == tile &&
+		if (v->type == VEH_Ship && IsShipInDepot(v) && v->tile == tile &&
 				--num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) {
 			DrawShipImage(v, x+19, y, WP(w,traindepot_d).sel);