Hi everybody,
I'm currently trying to set up the new leader trait "informed", which would double the Espionage Points for your faction.
In CvPlayer.cpp I have inserted a few lines (bold in the text segment below). Building the CvGameCoreDLL.dll and running the game I do more or less get what I want, only the points are now always doubled - regardless what faction I play.
Now my question is: who exactly is "GC", as in "GC.getTraitInfo((TraitTypes)iI).getEspModifier()"? - Is he a self reference to the active player or is he ANY player? Or somebody else?
Thanks for any help.
I'm currently trying to set up the new leader trait "informed", which would double the Espionage Points for your faction.
In CvPlayer.cpp I have inserted a few lines (bold in the text segment below). Building the CvGameCoreDLL.dll and running the game I do more or less get what I want, only the points are now always doubled - regardless what faction I play.
Now my question is: who exactly is "GC", as in "GC.getTraitInfo((TraitTypes)iI).getEspModifier()"? - Is he a self reference to the active player or is he ANY player? Or somebody else?
Thanks for any help.
Code:
void CvPlayer::doEspionagePoints()
{
if (getCommerceRate(COMMERCE_ESPIONAGE) > 0)
{
int iI;
GET_TEAM(getTeam()).changeEspionagePointsEver(getCommerceRate(COMMERCE_ESPIONAGE));
int iSpending = 0;
// Divide up Espionage between Teams
for (int iLoop = 0; iLoop < MAX_CIV_TEAMS; iLoop++)
{
if (getTeam() != iLoop)
{
if (GET_TEAM((TeamTypes)iLoop).isAlive())
{
if (GET_TEAM(getTeam()).isHasMet((TeamTypes)iLoop))
{
iSpending = getEspionageSpending((TeamTypes)iLoop);
[B]for (iI = 0; iI < GC.getNumTraitInfos(); iI++) // new segment
{ //
if (GC.getTraitInfo((TraitTypes)iI).getEspModifier() == 100) //
{ //
iSpending *= 2; //
}[/B] // end of segment
}
if (iSpending > 0)
{
GET_TEAM(getTeam()).changeEspionagePointsAgainstTeam((TeamTypes)iLoop, iSpending);
}
}
}
}
}
}
}