summaryrefslogtreecommitdiff
path: root/src/network/network_chat_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/network_chat_gui.cpp')
-rw-r--r--src/network/network_chat_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp
index 17e17e32c..9f896c185 100644
--- a/src/network/network_chat_gui.cpp
+++ b/src/network/network_chat_gui.cpp
@@ -318,7 +318,7 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
/* Then, try townnames
* Not that the following assumes all town indices are adjacent, ie no
* towns have been deleted. */
- if (*item <= (uint)MAX_CLIENT_SLOTS + GetMaxTownIndex()) {
+ if (*item < (uint)MAX_CLIENT_SLOTS + Town::GetPoolSize()) {
const Town *t;
FOR_ALL_TOWNS_FROM(t, *item - MAX_CLIENT_SLOTS) {