Teg_Navanis
King
- Joined
- Jan 21, 2006
- Messages
- 737
happened when I attacked Orthus with a Pyre Zombie:
Traceback (most recent call last):
File "CvEventInterface", line 24, in onEvent
File "CvEventManager", line 173, in handleEvent
File "CvEventManager", line 655, in onCombatResult
ArgumentError: Python argument types in
CyUnit.isHasPromotion(CyUnit, str)
did not match C++ signature:
isHasPromotion(class CyUnit {lvalue}, int)
ERR: Python function onEvent failed, module CvEventInterface
Edit: Just to annoy woodelf a bit more
to
Traceback (most recent call last):
File "CvEventInterface", line 24, in onEvent
File "CvEventManager", line 173, in handleEvent
File "CvEventManager", line 655, in onCombatResult
ArgumentError: Python argument types in
CyUnit.isHasPromotion(CyUnit, str)
did not match C++ signature:
isHasPromotion(class CyUnit {lvalue}, int)
ERR: Python function onEvent failed, module CvEventInterface
Edit: Just to annoy woodelf a bit more

Code:
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
iRnd = CyGame().getSorenRandNum(30, "Bob") - 10
if pUnit.isHasPromotion('PROMOTION_FIRE_RESISTANCE'):
iRnd = iRnd - 10
if pUnit.isHasPromotion('PROMOTION_VULNERABLE_TO_FIRE'):
iRnd = iRnd + 10
if iRnd >= 1:
pUnit.setDamage(pUnit.getDamage() + iRnd, True)
to
Code:
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
iRnd = CyGame().getSorenRandNum(30, "Bob") - 10
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_FIRE_RESISTANCE')):
iRnd = iRnd - 10
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_VULNERABLE_TO_FIRE')):
iRnd = iRnd + 10
if iRnd >= 1:
pUnit.setDamage(pUnit.getDamage() + iRnd, True)