Code:
void CvPlayer::doTurn()
{
PROFILE_FUNC();
CvCity* pLoopCity;
int iLoop;
FAssertMsg(isAlive(), "isAlive is expected to be true");
FAssertMsg(!hasBusyUnit() || GC.getGameINLINE().isMPOption(MPOPTION_SIMULTANEOUS_TURNS) || GC.getGameINLINE().isSimultaneousTeamTurns(), "End of turn with busy units in a sequential-turn game");
CvEventReporter::getInstance().beginPlayerTurn( GC.getGameINLINE().getGameTurn(), getID());
doUpdateCacheOnTurn();
GC.getGameINLINE().verifyDeals();
AI_doTurnPre();
//Kathy: Dynamic Handicap Level Beginn
if (GC.getGameINLINE().isOption(GAMEOPTION_DYNAMIC_HANDICAP_LEVEL))
{
if (isHuman())
{
if ( this->getHandicapType() < GC.getNumHandicapInfos()-1 )
{
if ( this->calculateScore() > (this->getHandicapType()+1)*500)
{
HandicapTypes eHandicap;
eHandicap = this->getHandicapType();
int iHandicapID;
iHandicapID = this->getHandicapType()+1;
HandicapTypes eNewHandicap;
eNewHandicap = static_cast<HandicapTypes>(iHandicapID);
GC.getInitCore().setHandicap(this->getID(),eNewHandicap);
CvWString szBuffer;
szBuffer = gDLL->getText("TXT_KEY_MISC_LEADER_PROMOTED", getNameKey(), GC.getHandicapInfo(eHandicap).getDescription(), GC.getHandicapInfo(eNewHandicap).getDescription());
PlayerTypes eActivePlayer;
eActivePlayer = this->getID();
gDLL->getInterfaceIFace()->addMessage(eActivePlayer, false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_COMBAT", MESSAGE_TYPE_INFO, "", (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), -1, -1, true, true);
}
}
}
}
//Kathy: Dynamic Handicap Level End
//Kathy Beginn Citystates
GET_TEAM(getTeam()).UpdateVassals(getTeam());
//Kathy End Citystates
if (getRevolutionTimer() > 0)
{
changeRevolutionTimer(-1);
}
if (getConversionTimer() > 0)
{
changeConversionTimer(-1);
}
setConscriptCount(0);
AI_assignWorkingPlots();
if (0 == GET_TEAM(getTeam()).getHasMetCivCount(true) || GC.getGameINLINE().isOption(GAMEOPTION_NO_ESPIONAGE))
{
setCommercePercent(COMMERCE_ESPIONAGE, 0);
}
verifyGoldCommercePercent();
doGold();
doResearch();
doEspionagePoints();
/************************************************************************************************/
/* BETTER_BTS_AI_MOD 05/08/09 jdog5000 */
/* */
/* City AI */
/************************************************************************************************/
// New function to handle wonder construction in a centralized manner
GET_PLAYER(getID()).AI_doCentralizedProduction();
/************************************************************************************************/
/* BETTER_BTS_AI_MOD END */
/************************************************************************************************/
for (pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))
{
pLoopCity->doTurn();
}
if (getGoldenAgeTurns() > 0)
{
changeGoldenAgeTurns(-1);
}
if (getAnarchyTurns() > 0)
{
//Kathy: Barbaren von Anarchie Beginn
CvCity* pCapitalCity;
pCapitalCity = getCapitalCity();
if (pCapitalCity != NULL )
{
int iNumBarbUnits;
UnitTypes eBarbarianUnit;
CvWString szBuffer;
iNumBarbUnits = getNumCities()/10+getAnarchyTurns();
eBarbarianUnit = pCapitalCity->getConscriptUnit() ;
if ( doBarbarianUprising(pCapitalCity,iNumBarbUnits,eBarbarianUnit) )
{
szBuffer = gDLL->getText("TXT_KEY_MESSAGE_ANARCHY_BARBARIAN", GC.getUnitInfo(eBarbarianUnit).getDescription(), GC.getUnitInfo(eBarbarianUnit).getDescription() );
PlayerTypes eActivePlayer;
eActivePlayer = this->getID();
gDLL->getInterfaceIFace()->addMessage( eActivePlayer, false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_FIRSTTOTECH", MESSAGE_TYPE_MAJOR_EVENT, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_RED"));
}
}
//Kathy: Barbaren von Anarchie ENd
changeAnarchyTurns(-1);
}
//Kathy Beginn CityState Missionen
doVerifyCityStateMissionsDone();
doNewCityStateMissions();
//Kathy End CityState Missionen
//Kathy Boycott Beginn
if (getBoycottTurns() > 0)
{
changeBoycottTurns(-1);
}
//Kathy Boycott End
verifyCivics();
updateTradeRoutes();
updateWarWearinessPercentAnger();
doEvents();
updateEconomyHistory(GC.getGameINLINE().getGameTurn(), calculateTotalCommerce());
updateIndustryHistory(GC.getGameINLINE().getGameTurn(), calculateTotalYield(YIELD_PRODUCTION));
updateAgricultureHistory(GC.getGameINLINE().getGameTurn(), calculateTotalYield(YIELD_FOOD));
updatePowerHistory(GC.getGameINLINE().getGameTurn(), getPower());
updateCultureHistory(GC.getGameINLINE().getGameTurn(), countTotalCulture());
updateEspionageHistory(GC.getGameINLINE().getGameTurn(), GET_TEAM(getTeam()).getEspionagePointsEver());
expireMessages(); // turn log
gDLL->getInterfaceIFace()->setDirty(CityInfo_DIRTY_BIT, true);
AI_doTurnPost();
/************************************************************************************************/
/* BETTER_BTS_AI_MOD 07/08/09 jdog5000 */
/* */
/* Debug */
/************************************************************************************************/
if( GC.getGameINLINE().isDebugMode() )
{
GC.getGameINLINE().updateColoredPlots();
}
/************************************************************************************************/
/* BETTER_BTS_AI_MOD END */
/************************************************************************************************/
CvEventReporter::getInstance().endPlayerTurn( GC.getGameINLINE().getGameTurn(), getID());
}
void CvPlayer::doTurnUnits()
{
PROFILE_FUNC();
CvSelectionGroup* pLoopSelectionGroup;
int iLoop;
AI_doTurnUnitsPre();
for(pLoopSelectionGroup = firstSelectionGroup(&iLoop); pLoopSelectionGroup != NULL; pLoopSelectionGroup = nextSelectionGroup(&iLoop))
{
pLoopSelectionGroup->doDelayedDeath();
}
for (int iPass = 0; iPass < 4; iPass++)
{
for(pLoopSelectionGroup = firstSelectionGroup(&iLoop); pLoopSelectionGroup != NULL; pLoopSelectionGroup = nextSelectionGroup(&iLoop))
{
switch (pLoopSelectionGroup->getDomainType())
{
case DOMAIN_AIR:
if (iPass == 1)
{
pLoopSelectionGroup->doTurn();
}
break;
case DOMAIN_SEA:
if (iPass == 2)
{
pLoopSelectionGroup->doTurn();
}
break;
case DOMAIN_LAND:
if (iPass == 3)
{
pLoopSelectionGroup->doTurn();
}
break;
case DOMAIN_IMMOBILE:
if (iPass == 0)
{
pLoopSelectionGroup->doTurn();
}
break;
case NO_DOMAIN:
FAssertMsg(NULL == pLoopSelectionGroup->getHeadUnit(), "Unit with no Domain");
default:
if (iPass == 3)
{
pLoopSelectionGroup->doTurn();
}
break;
}
}
}
if (getID() == GC.getGameINLINE().getActivePlayer())
{
gDLL->getFAStarIFace()->ForceReset(&GC.getInterfacePathFinder());
gDLL->getInterfaceIFace()->setDirty(Waypoints_DIRTY_BIT, true);
gDLL->getInterfaceIFace()->setDirty(SelectionButtons_DIRTY_BIT, true);
}
gDLL->getInterfaceIFace()->setDirty(UnitInfo_DIRTY_BIT, true);
AI_doTurnUnitsPost();
}
Beide seit mehreren Versionen nicht mehr angeführt. Ich kann nicht genau sagen, wo das Programm jetzt sein müsste - aber ich habe auch keine Idee, was ich daran ändern soll, damit ich irgendwie einen Hinweis auf das Problem bekomme - oder das Problem umgehen kann.