Is the python function, cannotTrain being incorrectly used? Looking through the DLL, this function is only called from the canUpgrade function. However, the pyton has lots of code checking for existing numbers of units such as the following snippet:
The section of this code is obviously meant for the AI, but if I understand it correctly, it's telling the AI to not upgrade Demagogs if it has more then 6 Demagogs, which doesn't seem to make much sense. Am I misunderstanding what this code is doing?
Code:
if eUnit == gc.getInfoTypeForString('UNIT_DEMAGOG'):
if pPlayer.getUnitClassCount(gc.getInfoTypeForString('UNITCLASS_DEMAGOG')) > 6:
return True
The section of this code is obviously meant for the AI, but if I understand it correctly, it's telling the AI to not upgrade Demagogs if it has more then 6 Demagogs, which doesn't seem to make much sense. Am I misunderstanding what this code is doing?