freeserf.net
freeserf.net copied to clipboard
Crash when conquering enemy castle
I got the same exception on the same line in a different game when conquering the enemy castle.
Freeserf had same issue. I believe it was due to the now-deleted Inventory object nullptr checked? I forget exactly, the fix is somewhere in Forkserf changelog
Thank you for the info. Imagine if there were no forks and everyone was working on the same code :)
I didnt debug it yet but I think this problem is that the castle flag was not connected because all roads and building connected to the castle was already conquered. The code expects a flag to have at least one connected.
Fix in Flag.cs.MergePaths(). This fixes the crash but I dont know how it is good enough as the final solution.
From var path1Data = new SerfPathInfo(); var path2Data = new SerfPathInfo();
To // This could happen when a castle is conquered and it has no path anywhere if ( path1Direction == path2Direction ) { return; }
var path1Data = new SerfPathInfo();
var path2Data = new SerfPathInfo();