summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-24 09:53:15 +0000
committerrubidium <rubidium@openttd.org>2008-12-24 09:53:15 +0000
commitd1bb5e5f3632ada5336cd0408e11a6d17f43a5b7 (patch)
tree04c454a456e353e63a9ba8a438b575b0902b93e0 /src/network
parent5b26afbd6b0446373a9f21ec80ee8bac82c11f0b (diff)
downloadopenttd-d1bb5e5f3632ada5336cd0408e11a6d17f43a5b7.tar.xz
(svn r14735) -Codechange: remove a bit of bit-waste in the map array (without changing the map array) and make the CompanyIDs contiguous.
-Note: 15 should be enough for now... making it any more means adding more bytes to the map array and thus wasting more bits instead of reducing the bit waste.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_gui.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 2a3ff1ca3..2c1ca0537 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -1189,6 +1189,8 @@ struct NetworkLobbyWindow : public Window {
SetDParamStr(0, gi->server_name);
this->DrawWidgets();
+ SetVScrollCount(this, gi->companies_on);
+
/* Draw company list */
pos = this->vscroll.pos;
while (pos < gi->companies_on) {
@@ -1207,7 +1209,7 @@ struct NetworkLobbyWindow : public Window {
pos++;
y += NET_PRC__SIZE_OF_ROW;
- if (pos >= this->vscroll.cap) break;
+ if (pos >= this->vscroll.pos + this->vscroll.cap) break;
}
/* Draw info about selected company when it is selected in the left window */