summaryrefslogtreecommitdiff
path: root/ship_gui.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-09-11 20:38:35 +0000
committerbjarni <bjarni@openttd.org>2006-09-11 20:38:35 +0000
commit9532c873c12b6d8f3c2715707d76b764251af2df (patch)
tree969505d315e3eb22ee3adb4e6a8c1cc9315d557f /ship_gui.c
parent86ba1561a39837177ba23c2469eab069cbc1e674 (diff)
downloadopenttd-9532c873c12b6d8f3c2715707d76b764251af2df.tar.xz
(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
Diffstat (limited to 'ship_gui.c')
-rw-r--r--ship_gui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ship_gui.c b/ship_gui.c
index 0a0914e81..75374c3c7 100644
--- a/ship_gui.c
+++ b/ship_gui.c
@@ -620,7 +620,7 @@ static void DrawShipDepotWindow(Window *w)
/* 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 @@ static void DrawShipDepotWindow(Window *w)
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);