help with acquirecity

wait321

Chieftain
Joined
Feb 25, 2004
Messages
11
So I'm trying to give all of the cities of loopPlayer to pPlayer. But for some reason the code produces an unidentifiable C++ exception on the acquireCity line.

Code:
for iCity in range(loopPlayer.getNumCities()):
  loopCity = loopPlayer.getCity(iCity);
  pPlayer.acquireCity(loopCity, False, False);

Does anyone have an idea what's wrong?
 
One of the reason should be that the list of city IDs is not forced to be 0,1,...,numCities-1 . You can have a cityID larger than numCities-1 and a previous id that return a None city . You should use the list of city returned by PyHelpers .

Tcho !
 
Back
Top Bottom