phungus420
Deity
- Joined
- Mar 1, 2003
- Messages
- 6,296
OK, final step is setting up the functionality. Up until now I've been using the AndTechs as a template. But this is not an and function, it's an Or function, and I can't figure out how to tell the function to return false if there are specific civics set, but to return true if any one of the civics is being currently used by the player.
For code, I'll show the AndTechs as a template:
Any ideas how to change that code to a player is currently in a civic Or type check?
For code, I'll show the AndTechs as a template:
Code:
bool CvPlayer::canTrain(UnitTypes eUnit, bool bContinue, bool bTestVisible, bool bIgnoreCost) const
{
...
for (iI = 0; iI < GC.getNUM_UNIT_AND_TECH_PREREQS(); iI++)
{
if (GC.getUnitInfo(eUnit).getPrereqAndTechs(iI) != NO_TECH)
{
if (!(GET_TEAM(getTeam()).isHasTech((TechTypes)(GC.getUnitInfo(eUnit).getPrereqAndTechs(iI)))))
{
return false;
}
}
}
Any ideas how to change that code to a player is currently in a civic Or type check?