Debug: Log number of GRFs at level sl=2 when loading a game

Add helper to get the number of non-static GRFs in a GRF config
This commit is contained in:
Jonathan G Rennison
2024-04-29 20:14:37 +01:00
parent adc7840f01
commit c5cd598217
5 changed files with 17 additions and 9 deletions

View File

@@ -499,15 +499,8 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendNewGRFCheck()
return this->SendNeedGamePassword();
}
const GRFConfig *c;
uint grf_count = 0;
for (c = _grfconfig; c != nullptr; c = c->next) {
if (!HasBit(c->flags, GCF_STATIC)) grf_count++;
}
p->Send_uint32(grf_count);
for (c = _grfconfig; c != nullptr; c = c->next) {
p->Send_uint32(GetGRFConfigListNonStaticCount(_grfconfig));
for (const GRFConfig *c = _grfconfig; c != nullptr; c = c->next) {
if (!HasBit(c->flags, GCF_STATIC)) SerializeGRFIdentifier(*p, c->ident);
}