summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRubidium <rubidium@openttd.org>2021-05-05 20:38:18 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-05 21:01:23 +0200
commitead30dc725c60cac8bc13c86d18b179dac684bec (patch)
tree12452bcd7a37005c3885f9471d13d80a4e56985a /src
parente7581fd42d9740ca68adfc2ec55edb49d51af237 (diff)
downloadopenttd-ead30dc725c60cac8bc13c86d18b179dac684bec.tar.xz
Cleanup: [Network] Remove variable from NetworkGameInfo that is only used during deserialisation
Diffstat (limited to 'src')
-rw-r--r--src/network/core/game_info.cpp6
-rw-r--r--src/network/core/game_info.h1
2 files changed, 3 insertions, 4 deletions
diff --git a/src/network/core/game_info.cpp b/src/network/core/game_info.cpp
index 9f4d23b3b..47e6f221e 100644
--- a/src/network/core/game_info.cpp
+++ b/src/network/core/game_info.cpp
@@ -252,7 +252,7 @@ void DeserializeNetworkGameInfo(Packet *p, NetworkGameInfo *info)
{
static const Date MAX_DATE = ConvertYMDToDate(MAX_YEAR, 11, 31); // December is month 11
- info->game_info_version = p->Recv_uint8();
+ byte game_info_version = p->Recv_uint8();
/*
* Please observe the order.
@@ -262,7 +262,7 @@ void DeserializeNetworkGameInfo(Packet *p, NetworkGameInfo *info)
/* Update the documentation in game_info.h on changes
* to the NetworkGameInfo wire-protocol! */
- switch (info->game_info_version) {
+ switch (game_info_version) {
case 4: {
GRFConfig **dst = &info->grfconfig;
uint i;
@@ -302,7 +302,7 @@ void DeserializeNetworkGameInfo(Packet *p, NetworkGameInfo *info)
info->clients_max = p->Recv_uint8 ();
info->clients_on = p->Recv_uint8 ();
info->spectators_on = p->Recv_uint8 ();
- if (info->game_info_version < 3) { // 16 bits dates got scrapped and are read earlier
+ if (game_info_version < 3) { // 16 bits dates got scrapped and are read earlier
info->game_date = p->Recv_uint16() + DAYS_TILL_ORIGINAL_BASE_YEAR;
info->start_date = p->Recv_uint16() + DAYS_TILL_ORIGINAL_BASE_YEAR;
}
diff --git a/src/network/core/game_info.h b/src/network/core/game_info.h
index 7c84d7b15..ef83e4d05 100644
--- a/src/network/core/game_info.h
+++ b/src/network/core/game_info.h
@@ -85,7 +85,6 @@ struct NetworkServerGameInfo {
struct NetworkGameInfo : NetworkServerGameInfo {
bool version_compatible; ///< Can we connect to this server or not? (based on server_revision)
bool compatible; ///< Can we connect to this server or not? (based on server_revision _and_ grf_match
- byte game_info_version; ///< Version of the game info
};
extern NetworkServerGameInfo _network_game_info;