Dancing Hoskuld
Deity
I am maintaining some code that adds a number of religions to Rise of Mankind. RoM uses a variation on Sevopedia for its pedia. This variation displays the unique units for a religion on the pedia page ie religion missionary.
However it is not doing so for the added religions. They are modular and RoM uses the WoC standard for XML.
As far as I can see the code fragment everything should work fine unless getNumUnitClassInfos is not also counting the modular units. Is this so? If so is there something I should be using instead?
Code fragment is:-
Whatever problem is happening here it is also happening with the extra corporate executives also. It has very similar code.
However it is not doing so for the added religions. They are modular and RoM uses the WoC standard for XML.
As far as I can see the code fragment everything should work fine unless getNumUnitClassInfos is not also counting the modular units. Is this so? If so is there something I should be using instead?
Code fragment is:-
Code:
def placeUnit(self):
...
for iUnit in [B]range(gc.getNumUnitClassInfos())[/B]:
iPrereq = gc.getUnitInfo(iUnit).getPrereqReligion()
iPrereq2 = gc.getUnitInfo(iUnit).getReligionType()
iPrereq3 = gc.getUnitInfo(iUnit).getStateReligion()
if (iPrereq == self.iReligion or iPrereq2 == self.iReligion or iPrereq3 == self.iReligion):
screen.attachImageButton(panelName, "", gc.getUnitInfo(iUnit).getButton(), ...)
Whatever problem is happening here it is also happening with the extra corporate executives also. It has very similar code.