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:
@@ -72,8 +72,6 @@ void NetworkGameListRemoveItem(NetworkGameList *remove)
|
||||
prev_item->next = remove->next;
|
||||
}
|
||||
|
||||
/* Remove GRFConfig information */
|
||||
ClearGRFConfigList(remove->info.grfconfig);
|
||||
delete remove;
|
||||
|
||||
NetworkRebuildHostList();
|
||||
@@ -99,8 +97,6 @@ void NetworkGameListRemoveExpired()
|
||||
item = item->next;
|
||||
*prev_item = item;
|
||||
|
||||
/* Remove GRFConfig information */
|
||||
ClearGRFConfigList(remove->info.grfconfig);
|
||||
delete remove;
|
||||
} else {
|
||||
prev_item = &item->next;
|
||||
@@ -121,7 +117,7 @@ void NetworkAfterNewGRFScan()
|
||||
/* Reset compatibility state */
|
||||
item->info.compatible = item->info.version_compatible;
|
||||
|
||||
for (GRFConfig *c = item->info.grfconfig; c != nullptr; c = c->next) {
|
||||
for (auto &c : item->info.grfconfig) {
|
||||
assert(HasBit(c->flags, GCF_COPY));
|
||||
|
||||
const GRFConfig *f = FindGRFConfig(c->ident.grfid, FGCM_EXACT, &c->ident.md5sum);
|
||||
|
||||
Reference in New Issue
Block a user