OrionVeteran
Deity
I have come across a really strange issue: I have a problem creating a unit. This unit is called the MTI and it has two prerequisites:
If a user plays a civ that has a Unique Building (UB) for the barracks, i.e. Zulu, Shaka, BUILDING_ZULU_IKHANDA; The icon fails to light up to add the MTI into the build cue. Both the Barracks and the Ikhanda have the same BuildingClass:
If the user plays a civ, without a UB for the barracks, the icon lights up every time, when both prerequisites are met. The failure seems to occur in the CvMainInterface.py file at the point where the code determines what the iUnitType is. In this case:
I tried to replace that line with:
...but had the same result. The code failed to progress past this line. It makes no sense to me why this is happening.

Update: If I take away the prerequisit for the Barracks, the icon works. So it all comes down to the building type.
Code:
<PrereqBuilding>BUILDING_BARRACKS</PrereqBuilding>
<PrereqTech>TECH_ORGANIZED_WARFARE</PrereqTech>
If a user plays a civ that has a Unique Building (UB) for the barracks, i.e. Zulu, Shaka, BUILDING_ZULU_IKHANDA; The icon fails to light up to add the MTI into the build cue. Both the Barracks and the Ikhanda have the same BuildingClass:
Code:
<BuildingClass>BUILDINGCLASS_BARRACKS</BuildingClass>
<Type>BUILDING_ZULU_IKHANDA</Type>
If the user plays a civ, without a UB for the barracks, the icon lights up every time, when both prerequisites are met. The failure seems to occur in the CvMainInterface.py file at the point where the code determines what the iUnitType is. In this case:
Code:
if iUnitType == gc.getInfoTypeForString("UNIT_MTI"):
I tried to replace that line with:
Code:
if iUnitClassType == gc.getInfoTypeForString("UNITCLASS_MTI"):
...but had the same result. The code failed to progress past this line. It makes no sense to me why this is happening.


Update: If I take away the prerequisit for the Barracks, the icon works. So it all comes down to the building type.