In main.cpp:17 (starting line 17), you have this section:
// Declaring Classes
UnitHelper::VehicleBuilder vehicleBuilderAI;
AIFightGroups::AIFightGroupMaker fightGroupMaker;
ScriptGlobal scriptGlobal;
The vehicleBuilderAI and fightGroupMaker variables are outside of the scriptGlobal struct. These will not be saved and restored during a game save/load. After loading a game, these variables are in a sense uninitialized. Using them could be related to crashes you've been seeing.
Rather than post a bunch of nitpicks, perhaps I'll go through a bit of the code, and if I see things, I'll make changes and commit them. The commit messages will explain each change. Run an SVN update when you want to see the changes, and before you work on your project next.
Thank you Hooman, for reviewing. I'll stay out of the code until you give the all clear and then review the commit logs for what has been changed.
Hooman and Vagabond stand at attention
Hooman: "I relieve you"
Vagabond: "I stand relieved. Attention on the bridge, Hooman has the deck."
----
I am reinitializing vehicleBuilderAI and fightGroup Maker in the AIProc function (assuming I wrote the code correctly?), however this is a bit of a hack. I didn't realize I could put custom classes in the scriptGlobal function.
//From AIProc function
//NOTE: When the VehicleBuilder class is instantiated after a game is loaded, it defaults to player 0.
if (vehicleBuilderAI.GetPlayer() != 1)
{
InitializeAIHelperClasses();
}
----
For the Victory condition bug crashing the game after loading a save file. Even if I strip all the code from the project except for 1 victory condition, this still occurs so I really believe this is being caused external to the code. Perhaps something to do with how I link into the SDK or something?
I would like to remove all the SDK code from the project and just link to the SDK projects in the repository, but they are built using Visual Studio 2010. I'm guessing they would have to be updated to Visual Studio 2015 for me to use, or I would need to drop to Visual Studio 2010. Microsoft makes it difficult by coming out with a new Visual Studio version every 2 years.