Skip to content

Conversation

@helmutbuhler
Copy link

Fixes: #1436

The UpgradeCenter class doesn't reset itself properly and as such can cause mismatches in a second match when the upgrades were modified due to custom scripts in a first match.

This PR fixes it by reloading the corresponding INI files during reset. Not exactly elegant, but it works!

@helmutbuhler helmutbuhler added Crash This is a crash, very bad Script Is related to Script Engine, SCB labels Oct 26, 2025
xferCRC.open("lightCRC");
INI ini;
ini.loadFileDirectory("Data\\INI\\Default\\Upgrade", INI_LOAD_OVERWRITE, &xferCRC);
ini.loadFileDirectory("Data\\INI\\Upgrade", INI_LOAD_OVERWRITE, &xferCRC);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest take a look at INI_LOAD_CREATE_OVERRIDES to see if this problem can be properly fixed by using INI overrides. I suspect that there are more systems that currently do not handle overrides correctly.

map.ini is loaded with this special flag for this very purpose.

	sprintf(fullFledgeFilename, "%s\\map.ini", filename);
	if (TheFileSystem->doesFileExist(fullFledgeFilename)) {
		DEBUG_LOG(("Loading map.ini"));
		INI ini;
		ini.load( AsciiString(fullFledgeFilename), INI_LOAD_CREATE_OVERRIDES, NULL );
	}

@xezon xezon added Bug Something is not working right, typically is user facing Major Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Mod Relates to Mods or modding and removed Crash This is a crash, very bad Script Is related to Script Engine, SCB labels Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Gen Relates to Generals Major Severity: Minor < Major < Critical < Blocker Mod Relates to Mods or modding ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mismatch in UpgradeTemplate data after playing a map with map.ini with custom upgrades

2 participants