diff --git a/src/network/core/network_game_info.cpp b/src/network/core/network_game_info.cpp index d2f84aca83..c367db6113 100644 --- a/src/network/core/network_game_info.cpp +++ b/src/network/core/network_game_info.cpp @@ -223,7 +223,7 @@ void SerializeNetworkGameInfo(Packet *p, const NetworkServerGameInfo *info, bool for (c = info->grfconfig; c != nullptr; c = c->next) { if (!HasBit(c->flags, GCF_STATIC)) count++; } - p->Send_uint8(std::min(count, NETWORK_MAX_GRF_COUNT)); // Send number of GRFs + p->Send_uint8(ClampTo(std::min(count, NETWORK_MAX_GRF_COUNT))); // Send number of GRFs /* Send actual GRF Identifications */ for (c = info->grfconfig; c != nullptr; c = c->next) { diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index 1e7ee98d82..112cae666e 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -603,7 +603,7 @@ struct NewGRFInspectWindow : Window { if (iter != lines.end() && iter->first == (int)highlight_tag) { /* Already stored, don't insert again */ } else { - lines.insert(iter, std::make_pair(highlight_tag, std::min(UINT16_MAX, i))); + lines.insert(iter, std::make_pair(highlight_tag, ClampTo(i))); } }