1.3.3 Structure_Create bug

Moderator: Pocus

Post Reply
n0b0dy007
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 48
Joined: Sat Dec 07, 2019 3:52 pm

1.3.3 Structure_Create bug

Post by n0b0dy007 »

After updating, and purchasing/installing the DLC, continued an existing save game. May be an odd corner case.
DebugBreak in Structure.bsf/Structure_Create() with an invalid(0) regionID. GetScriptStack() shows:

Code: Select all

Structure_Create in D:/SteamLibrary/steamapps/common/Field of Glory Empires/Data/Scripts/MAP.BSF
Province_CheckCapitol @ 22915
Region_EndTurnUpdate_All @ 70070
Host_ResolveEndTurn @ 86001
Host_ResolveEndOfImpulse_PostBattle @ 85919
Host_Battle_ProcessRemaining @ 86429
Host_ResolveEndOfImpulse_PreBattle @ 85862
Host_ResolveTurnSingleTick @ 85838
UpdateMap @ 112644
I didn't find the cause (but I didn't look too exhaustively, either :roll: ), so I patched Structure.bsf with a precondition check to log and ignore the error:

Code: Select all

	if ((factionID <= 0) || (regionID <= 0) || (strucTplID <= 0))	// @FIXME
	{
		GetScriptStack(0);
		TraceLog("ERROR in Structure_Create(), Stack:\n%w", 0);
		return
	}
	strucID = CreateStructure(factionID, regionID, strucTplID); // UNIQUE: if searched, only this line must be found in all scripts
trace.log and old/new Structure.bsf included in attached CreateStruct.zip.
Attachments
CreateStruct.zip
(20.28 KiB) Downloaded 85 times
Post Reply

Return to “Field of Glory: Empires - Tech Support”