Kailric
Jack of All Trades
I am simply trying to add a CivicPrereq to the Promotions XML using the FfH source code as an example. I have already done a new promotionprereq3 attribute so I learned a little bit about it but this is bugging me. One thing is I can't find where the GC.getDefineINT("MAX_CIVIC_OPTIONS") are at.
Thier example code:
My code:
I keep getting a "CvUnit.cpp(11061) : warning C4101: 'iI' : unreferenced local variable" error when I compile mine.
And then a "info class incorrect" error in the Promotions XML when I load the game with my dll.
Note: My Civicprereq starts with "Civic" and theirs start with "Prereq" but my XMLs read it like I have it so there is no problem there.
Any help here?
Thier example code:
Code:
//FfH Spell System: Added by Kael 07/23/2007
int iI;
CvPlot* pPlot = plot();
if (m_pUnitInfo->isAbandon())
{
bool bValid = true;
if (m_pUnitInfo->getPrereqCivic() != NO_CIVIC)
{
bValid = false;
for (int iI = 0; iI < GC.getDefineINT("MAX_CIVIC_OPTIONS"); iI++)
{
[B]if (GET_PLAYER(getOwnerINLINE()).getCivics((CivicOptionTypes)iI) == m_pUnitInfo->getPrereqCivic())[/B]
{
bValid = true;
}
}
if (GET_PLAYER(getOwnerINLINE()).isAnarchy())
{
bValid = true;
}
}
if (bValid == true)
{
if (m_pUnitInfo->getStateReligion() != NO_RELIGION)
{
bValid = false;
if (GET_PLAYER(getOwnerINLINE()).getStateReligion() == m_pUnitInfo->getStateReligion())
{
bValid = true;
}
}
}
if (bValid == false)
{
gDLL->getInterfaceIFace()->addMessage((PlayerTypes)getOwnerINLINE(), true, GC.getDefineINT("EVENT_MESSAGE_TIME"), gDLL->getText("TXT_KEY_MESSAGE_UNIT_ABANDON", getNameKey()), GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(), MESSAGE_TYPE_INFO, m_pUnitInfo->getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), plot()->getX_INLINE(), plot()->getY_INLINE());
kill(true);
}
}
My code:
Code:
int iI;
if (GC.getPromotionInfo(ePromotion).getCivicPrereq() != NO_CIVIC)
{
for (int iI = 0; iI < GC.getDefineINT("MAX_CIVIC_OPTIONS"); iI++)
{
[B] if (GET_PLAYER(getOwnerINLINE()).getCivics((CivicOptionTypes)iI) != GC.getPromotionInfo(ePromotion).getCivicPrereq())[/B]
{
return false;
}
}
}
I keep getting a "CvUnit.cpp(11061) : warning C4101: 'iI' : unreferenced local variable" error when I compile mine.
And then a "info class incorrect" error in the Promotions XML when I load the game with my dll.
Note: My Civicprereq starts with "Civic" and theirs start with "Prereq" but my XMLs read it like I have it so there is no problem there.
Any help here?