I found the cause of the crash.
CvCity.cpp line 2415
CvCity::canConstruct()
Inside the //Shqype Vicinity Bonus block
Code:
CvPlot* pLoopPlot = plotCity(getX_INLINE(), getY_INLINE(), iI);
if ([B]pLoopPlot != NULL &&[/B] pLoopPlot->getBonusType() == kBuilding.getPrereqVicinityBonus())
Add the bold part and not only will it avoid the crash, it will even work as intended.
The issue is plotCity(). It is used to loop all plots within reach of the city, and the code works for this purpose. However if the city is close to the edge of the map, it can loop through plots outside the map. If that happens, NULL is returned. However the code assumes the plot pointer not to be NULL. In the savegame, a city is too close to the edge, which generates a NULL pointer, which in turn crashes the game.
The fix is quite simple. C++ has lazy boolean checks. If (A && B) will only check A and if A is false, then the result is false regardless of B, meaning the call to B is skipped. That is quite useful knowledge for two purposes. Here we have if (A != NULL && A->crashIfNULL), which effectively avoids the crash as the crash condition can't be reached. The other is that if there is a slow and fast check, put the fast one first to avoid spending ages on a slow check, only to discover the fast one failed.
The gameplay result of this fix will make the code work as intended. The goal is a bool check to see if a specific type of bonus is within reach. By skipping NULL plots, it is assumed NO_BONUS on those plots.
General rule:
always consider if a pointer can be NULL before using it!
If you think the pointer can't be null, make an assert check to see if you assume correctly.
Also I would recommend upgrading to Makefile 2.5. There you can make an assert build, which is nearly as optimized as release, but it triggers asserts like a debug build. That's quite useful for auto play to see if you get the game to run assert free. Also adapting that Makefile 1.0 to my system took me longer than it took me to find the bug once I managed to finish compiling the debug DLL. Makefile 2.5 should be a bit easier to move from one system to another.