Change gamelog to use std::vector

Move LoadCheckData to its own header
This commit is contained in:
Jonathan G Rennison
2023-07-03 22:42:28 +01:00
parent 5ae5ac3701
commit 0bf41dc1ff
23 changed files with 212 additions and 228 deletions

View File

@@ -389,12 +389,11 @@ static void ResetSignalHandlers()
*/
static const GRFIdentifier *GetOverriddenIdentifier(const GRFConfig *c)
{
const LoggedAction *la = &_gamelog_action[_gamelog_actions - 1];
if (la->at != GLAT_LOAD) return &c->ident;
const LoggedAction &la = _gamelog_actions.back();
if (la.at != GLAT_LOAD) return &c->ident;
const LoggedChange *lcend = &la->change[la->changes];
for (const LoggedChange *lc = la->change; lc != lcend; lc++) {
if (lc->ct == GLCT_GRFCOMPAT && lc->grfcompat.grfid == c->ident.grfid) return &lc->grfcompat;
for (const LoggedChange &lc : la.changes) {
if (lc.ct == GLCT_GRFCOMPAT && lc.grfcompat.grfid == c->ident.grfid) return &lc.grfcompat;
}
return &c->ident;