Fimbulvetr
Emperor
Code:
bool CyPlayer::isTurnActive()
{
return m_pPlayer ? m_pPlayer->isTurnActive() : false;
}
Code:
[COLOR="Green"]### ### ### civjo: finish "Infinite Loop" - begin ### ### ###[/COLOR]
[COLOR="Green"]### Shift + 0: force all units of all players to end turn[/COLOR]
if( theKey==int(InputTypes.KB_0) and self.customEM.bShift ):
for iPlayer in range(0, game.countCivPlayersEverAlive()):
pPlayer = gc.getPlayer(iPlayer)
if not pPlayer.isNone() [B]and pPlayer.isTurnActive()[/B]:
iNumUnits = pPlayer.getNumUnits()
print( "[COLOR="Gray"]~~~~~~~~~~~~~~~ %s (Player %s) %s units[/COLOR]" %
( gc.getCivilizationInfo(pPlayer.getCivilizationType()).getDescription(), iPlayer, iNumUnits ) )
iUnit = 0
iCountUnit = 0
while iCountUnit < iNumUnits:
pUnit = pPlayer.getUnit(iUnit)
if not pUnit.isNone():
pUnit.finishMoves()
print( "[COLOR="Gray"]%s~ [%s,%s] %s %s-%s: finishMoves()[/COLOR]" %
( iCountUnit, pUnit.getX(), pUnit.getY(), pUnit.getName(), pUnit.getGroupID(), pUnit.getID() ) )
iCountUnit += 1
iUnit += 1
[B]break[/B]
[COLOR="Green"]### ### ### civjo: finish "Infinite Loop" - end ### ### ###[/COLOR]