summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-01-23 14:47:38 +0000
committerrubidium <rubidium@openttd.org>2007-01-23 14:47:38 +0000
commit89865658b1963e81527c2d9ad3ecefb5f4bf20d0 (patch)
treea9eebe1e09f39f897049ec74be2d89b4b128a7c4 /src/network/core
parent10d6f066e4eecdffa52105d18d96ece80fce7679 (diff)
downloadopenttd-89865658b1963e81527c2d9ad3ecefb5f4bf20d0.tar.xz
(svn r8372) -Fix (8361): NUM_LANDSCAPE comes (via some detour) from openttd.h, which does not exist in the masterserver/updater.
Diffstat (limited to 'src/network/core')
-rw-r--r--src/network/core/config.h9
-rw-r--r--src/network/core/udp.cpp4
2 files changed, 11 insertions, 2 deletions
diff --git a/src/network/core/config.h b/src/network/core/config.h
index 0b80800f0..71f3983a9 100644
--- a/src/network/core/config.h
+++ b/src/network/core/config.h
@@ -42,6 +42,15 @@ enum {
NETWORK_MAX_GRF_COUNT = 55,
NETWORK_NUM_LANGUAGES = 4, ///< Number of known languages (to the network protocol) + 1 for 'any'.
+ /**
+ * The number of landscapes in OpenTTD.
+ * This number must be equal to NUM_LANDSCAPE, but as this number is used
+ * within the network code and that the network code is shared with the
+ * masterserver/updater, it has to be declared in here too. In network.cpp
+ * there is a compile assertion to check that this NUM_LANDSCAPE is equal
+ * to NETWORK_NUM_LANDSCAPES.
+ */
+ NETWORK_NUM_LANDSCAPES = 4,
};
#endif /* ENABLE_NETWORK */
diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp
index 38309d326..f20f98ba9 100644
--- a/src/network/core/udp.cpp
+++ b/src/network/core/udp.cpp
@@ -300,8 +300,8 @@ void NetworkUDPSocketHandler::Recv_NetworkGameInfo(Packet *p, NetworkGameInfo *i
info->map_set = NetworkRecv_uint8 (this, p);
info->dedicated = (NetworkRecv_uint8(this, p) != 0);
- if (info->server_lang >= NETWORK_NUM_LANGUAGES) info->server_lang = 0;
- if (info->map_set >= NUM_LANDSCAPE) info->map_set = 0;
+ if (info->server_lang >= NETWORK_NUM_LANGUAGES) info->server_lang = 0;
+ if (info->map_set >= NETWORK_NUM_LANDSCAPES) info->map_set = 0;
}
}