Codechange: Use std::vector for GRFConfig lists. (#10835)

This replaces the C-style custom managed linked-list and allows use of iterators etc.
This commit is contained in:
Peter Nelson
2025-01-31 17:09:09 +00:00
committed by GitHub
parent 40aeedeade
commit 5664b1e2f6
23 changed files with 248 additions and 384 deletions
+2 -2
View File
@@ -1560,11 +1560,11 @@ static bool LoadTTDPatchExtraChunks(LoadgameState *ls, int)
uint32_t grfid = ReadUint32(ls);
if (ReadByte(ls) == 1) {
GRFConfig *c = new GRFConfig("TTDP game, no information");
auto c = std::make_unique<GRFConfig>("TTDP game, no information");
c->ident.grfid = grfid;
AppendToGRFConfigList(_grfconfig, c);
Debug(oldloader, 3, "TTDPatch game using GRF file with GRFID {:08X}", std::byteswap(c->ident.grfid));
AppendToGRFConfigList(_grfconfig, std::move(c));
}
len -= 5;
}