summaryrefslogtreecommitdiff
path: root/src/network/core/game_info.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/core/game_info.cpp')
-rw-r--r--src/network/core/game_info.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/network/core/game_info.cpp b/src/network/core/game_info.cpp
index 138053b05..85d66807b 100644
--- a/src/network/core/game_info.cpp
+++ b/src/network/core/game_info.cpp
@@ -254,7 +254,7 @@ void SerializeNetworkGameInfo(Packet *p, const NetworkServerGameInfo *info, bool
* @param p the packet to read the data from.
* @param info the NetworkGameInfo to deserialize into.
*/
-void DeserializeNetworkGameInfo(Packet *p, NetworkGameInfo *info)
+void DeserializeNetworkGameInfo(Packet *p, NetworkGameInfo *info, const GameInfoNewGRFLookupTable *newgrf_lookup_table)
{
static const Date MAX_DATE = ConvertYMDToDate(MAX_YEAR, 11, 31); // December is month 11
@@ -300,6 +300,14 @@ void DeserializeNetworkGameInfo(Packet *p, NetworkGameInfo *info)
DeserializeGRFIdentifierWithName(p, &grf);
break;
+ case NST_LOOKUP_ID: {
+ if (newgrf_lookup_table == nullptr) return;
+ auto it = newgrf_lookup_table->find(p->Recv_uint32());
+ if (it == newgrf_lookup_table->end()) return;
+ grf = it->second;
+ break;
+ }
+
default:
NOT_REACHED();
}