Just pushed to SVN (4848):
- Fixed crash reported by Spoon
- Tweaked attack stack recruitment slightly
Note -the crash was really quite a subtle systemic problem, and the fix, although simple, is not exactly low risk, as it's capable of influencing a LOT of stuff rather subtly. Be on the look out for oddities!
For anyone interested in the details the issue was that progressive damage to a unit that eventually kills it, results in a call to CvUnit::kill() that specifies 'bDelayDeath=true' (from CvUnit::setDamage(), which is used all over the place). A call to kill with bDelayDeath merely marks the unit as dead, but doesn't delete it - this is (I think) to support animations that (may) need to play for the unit in question, and which require it to still exist. However, later in the turn AIs nearby 'see' the (dead) units and try to bombard them - in trying to pick the best defender the (dead) stack crashes out (getBestDefender() returns NULL). Since I dare not mess with the delay death usage (chances are that would causes animation crashes in at least some circumstances), I have modified CvPlot:

lotCount() to not count dead units in any evaluation, which should make the dead units 'invisible' to other AI routines, so they should be able to move through the plot as if the dead unit were not there, and not try to take any action against it.
This is a change to a VERY low-level function in widespread usage however, so it certainly is not risk-free.
It solves the problem for Spoon's save, but I cannot be sure there won't be other consequences...