Ket said:Bug Report 100% Reproducible
1) Target City With Nukes
2) Destroy City Either Normally Or With A Nuke
3) End Turn
4) Game will crash, no debug info in the logs to report
Assumption:
This was done using my mod after I did a merge and clean compile of the mod.
Old Nuke Targeting City was not altered so the turn ended with a nuke targeting a city that no longer existed.
Warlords SDK
Secondary Note:
I went into world Builder and gave all Civs a nuke and S.A.C.
Declared war on one
Went a few turns, I never got targeted.
Of course nukes in 3500bc is fun! wondering if that had anything to do with it.
void CvUnit::doTurn()
{
...
iRandPlayer = (rand() % MAX_PLAYERS);
if(GET_PLAYER((PlayerTypes)iRandPlayer).isAlive() && GET_PLAYER((PlayerTypes)iRandPlayer).getID() != getOwnerINLINE())
{
if(!atWar(getTeam(), GET_PLAYER((PlayerTypes)iRandPlayer).getTeam()) && isPotentialEnemy(GET_PLAYER((PlayerTypes)iRandPlayer).getTeam(), getTeam()))
{
iNumCities = GET_PLAYER((PlayerTypes)iRandPlayer).getNumCities();
pCity = GET_PLAYER((PlayerTypes)iRandPlayer).getCity(rand() % iNumCities);
TheLopez said:Matze, does this error exist in Dale's MAD code as well? I ask this since that's where I got most of the MAD code for this mod.
EDIT: Wouldn't the code not be executed because isAlive would return false for a dying player?
MatzeHH said:I mean a player with no more cities but with some units left.
Matze