@Koshling:
I was playing along fine when all of the sudden the game crashed. This is more interesting though because when I read the minidump, the error was integer division by 0 in this equation
Code:
int iMoves = (iRouteCost*stepDistance(iFromX, iFromY, iToX, iToY) + iMin - 1)/iMin;
(line 2604 of the CvGameCoreUtils)
I would bet much money that iMin is being returned as 0. My question is, what is necessary to apply a sticky-tape bandage to this? This code has been there for many versions, and this is the first crash I've seen involving it. The previous functions were part of your pathing engine (CvPathGenerator), but I suspect that making it check somewhere to make sure that iMin isn't 0 would fix things.
Edit: Here is what I get in the debug window after loading the minidump.
Edit2: Could this have anything to do with the Tribal Guardian? It has 0 moves, and some have reported crashes with it. This was during the AI's turn though, so I wasn't clicking on it or anything.
Edit3: Would this be a good fix?
PHP:
int iMoves = 0;
if (iMin != 0)
{
iMoves = (iRouteCost*stepDistance(iFromX, iFromY, iToX, iToY) + iMin - 1)/iMin;
}
else
{
iMoves = 0;
}
I know that it would solve the crash, but would it mess up anything else?
Edit4: No, that would cause a crash later on in the code. Would checking for maxMoves being 0 and if so leaving the case loop work, or would that cause a WfOC? The function if you are wondering is NewPathHeuristicFunc().