import SystemPaths as SP
import os
import os.path
def verifyModDir(szModPath):
git_directory = os.path.join(szModPath, "git_directory.txt")
if os.path.isfile(git_directory):
pFile = open(git_directory)
szModPath = pFile.read().rstrip("\n")
pFile.close()
return szModPath
g_szModPath = verifyModDir(SP.modDir)
def initPackage(szFolderName):
for szPath in os.listdir(os.path.join(g_szModPath, "Assets", "Python", szFolderName)):
try:
initModule = getattr(__import__(szPath[0:len(szPath) -3]), "init")
except:
continue
initModule()
not sure.What is it for?
void cvInternalGlobals::deleteInfoArrays()
{
deleteInfoArray(m_paBuildingClassInfo);
deleteInfoArray(m_paBuildingInfo);
deleteInfoArray(m_paSpecialBuildingInfo);
void cvInternalGlobals::deleteSpawnInfo(SpawnTypes eIndex)
{
delete m_paSpawnInfo[eIndex];
for (int iI = eIndex; iI < (int)m_paSpawnInfo.size() -1; iI++)
{
m_paSpawnInfo[iI] = m_paSpawnInfo[iI +1];
}
m_paSpawnInfo.pop_back();
}
void CvCorporationInfo::setChar(int i)
{
/************************************************************************************************/
/* TGA_INDEXATION 01/21/08 MRGENIE */
/* */
/* */
/************************************************************************************************/
/*
m_iChar = i;
*/
m_iChar = 8550 + (TGA_RELIGIONS + m_iTGAIndex) * 2;
/************************************************************************************************/
/* TGA_INDEXATION END */
/************************************************************************************************/
}
void CvCorporationInfo::setHeadquarterChar(int i)
{
/************************************************************************************************/
/* TGA_INDEXATION 01/21/08 MRGENIE */
/* */
/* */
/************************************************************************************************/
/*
m_iHeadquarterChar = i;
*/
m_iHeadquarterChar = 8551 + (TGA_RELIGIONS + m_iTGAIndex) * 2;
/************************************************************************************************/
/* TGA_INDEXATION END */
/************************************************************************************************/
}
Don't you think anyone would have mentioned it if the corporatuion icon on the city bar was using religion icons...Corporation and religion are mixed up. No idea if it's a mistake.
CvUnit* CvSelectionGroupAI::AI_getBestGroupSacrifice(const CvPlot* pPlot, bool bPotentialEnemy, bool bForce, bool bNoBlitz, bool bSuprise) const
{
int iBestValue = 0;
CvUnit* pBestUnit = NULL;
CLLNode<IDInfo>* pUnitNode = headUnitNode();
while (pUnitNode != NULL)
{
CvUnit* pLoopUnit = ::getUnit(pUnitNode->m_data);
pUnitNode = nextUnitNode(pUnitNode);
if (!pLoopUnit->isDead())
{
if ((pLoopUnit->getDomainType() == DOMAIN_AIR && pLoopUnit->canAirAttack())
|| (pLoopUnit->canAttack() && !(bNoBlitz && pLoopUnit->isBlitz() && pLoopUnit->isMadeAttack())))
{
if (bForce || (pLoopUnit->canMove() && pLoopUnit->canMoveInto(pPlot, true)))
{
const int iValue = pLoopUnit->AI_sacrificeValue(pPlot);
FAssertMsg(iValue >= 0, "iValue is expected to be greater than 0");
// we want to pick the last unit of highest value, so pick the last unit with a good value
if (iValue > 0 && iValue >= iBestValue)
{
iBestValue = iValue;
pBestUnit = pLoopUnit;
}
}
}
}
}
return pBestUnit;
}
This function doesn't exist in the vanilla CvUnit.h so removing it shouldn't cause a crash.I know removing and switching the order of those can cause crash but does anyone know about changing the args?
bool CvSelectionGroup::canEnterArea(TeamTypes eTeam, const CvArea* pArea, bool bIgnoreRightOfPassage) const
{
if (getNumUnits() > 0)
{
for (unit_iterator unitItr = beginUnits(); unitItr != endUnits(); ++unitItr)
{
if (!(*unitItr)->canEnterArea(eTeam, pArea, bIgnoreRightOfPassage))
{
return false;
}
}
return true;
}
return false;
}
bool CvSelectionGroup::isBusy()
{
if (getNumUnits() == 0 || getMissionTimer() > 0)
{
return true;
}
for (unit_iterator unitItr = beginUnits(); unitItr != endUnits(); ++unitItr)
{
const CvUnit* pLoopUnit = *unitItr;
if (pLoopUnit != NULL && pLoopUnit->isCombat())
{
return true;
}
}
return false;
}
While they shouldn't exist for long, there are points where they do legally, and worse, there have been times when empty selection groups have haunted the gamestate and we had no way to determine where that becomes possible. IF such an empty selection group hit certain routines, it might cause a bug, and at such a time, a debug effort like this may have been put in place to ensure that such a 'ghost' selection group can just chill without causing a collapse of the code in progress. AKA, there was cause at the time... it's possible that these ghost cases have been solved at this point too.That first check seems odd to me. y would code run on a selection group with 0 or less units.
Yeah, it can be got rid of regardless, there shouldn't be anywhere where units in a selection group can be null. If it happens its a bug and I will fix the root cause, although I have yet to see it.After switching to a for loop here I can get rid of the pLoopUnit != NULL right?
Did you moved NPC defines somehow?100 civ dll. Seems to work, I didn't test much tho. It should be possible to open CvDefines.h and change MAX_PLAYERS to whatever.