Passing a NULL CyUnit to CyPlot.getBestDefender()

LyTning94

Dragonborn
Joined
Nov 10, 2010
Messages
397
Location
Skyrim
I have a python function which calls CyPlot.getBestDefender() and it's giving me a python exception. First I tried to call it like this:

Code:
pDefender = gc.getPlayer(pDestPlot.getBestDefender(NO_PLAYER, pSelectionGroup.getOwner(), NULL, True).getOwner())

but the exception said that NO_PLAYER and NULL were not defined. So I tried changing them to -1 and 0 and now it's giving me another exception saying that I'm trying to pass an integer (0) when it should be a CyUnit object (as the third argument).

How do I pass a NULL CyUnit to this function???
 
In the SDK it allows for that value to be NULL...is this not the case in Python???
 
I already tried replacing it with 0 but it gave me an exception saying that I'm trying to pass an integer where I should be passing a CyUnit object. I'm not sure what else I should do. I suppose I could just throw a unit in there for the heck of it, since it doesn't really matter in this scenario...
 
Back
Top Bottom