Is there a difference between the return for getOwner() based on what type of object it is called on?
When it ought to pass because plot owner is the same as the player, it fails. I put the setName in to prove this check was failing, and it is, because I am getting the name "Marnok Marnok" on these units.
I admit a lack of sleep, but I can't see why this would be, at all.
Can anyone shed any light for me?
Code:
def reqMarnokBarbarianAllyDungeonConvert(caster):
pPlot = caster.plot()
pPlayer = gc.getPlayer(caster.getOwner())
pPlotOwner = gc.getPlayer(pPlot.getOwner())
if pPlot.getImprovementType() != gc.getInfoTypeForString('IMPROVEMENT_BARROW') and pPlot.getImprovementType() != gc.getInfoTypeForString('IMPROVEMENT_RUINS'):
return False
if pPlotOwner != pPlayer:
caster.setName(pPlotOwner.getName()+" "+pPlayer.getName())
return False
if pPlayer.hasTrait(gc.getInfoTypeForString('TRAIT_BARBARIAN')):
return True
return False
When it ought to pass because plot owner is the same as the player, it fails. I put the setName in to prove this check was failing, and it is, because I am getting the name "Marnok Marnok" on these units.
I admit a lack of sleep, but I can't see why this would be, at all.
Can anyone shed any light for me?