Flintlock1415
Emperor
Okay, I've got rid of that guy, but I now have a different error. It seems getType is not usable after pUnit
Here is my current code:
And the Error:
Here is my current code:
PHP:
def unitCannotMoveInto(self,argsList):
ePlayer = argsList[0]
iUnitId = argsList[1]
iPlotX = argsList[2]
iPlotY = argsList[3]
## Locomotive Route Restriction
pUnit = gc.getPlayer(ePlayer).getUnit(iUnitId)
iTrainType = gc.getInfoTypeForString ( "UNIT_TRAIN" )
if pUnit.getType() == iTrainType:
pPlot = CyMap().plot(iPlotX, iPlotY)
iRoute = gc.getInfoTypeForString ( "ROUTE_RAILROAD" )
CyInterface().addImmediateMessage("Testing plot with route %d against %d" % (pPlot.getRouteType(), iRoute), "")
if pPlot.getRouteType() != iRoute:
return True
## End Edit
CyInterface().addImmediateMessage("Allowing move", "")
return False
Spoiler :
File "CvGameInterface", line 66, in unitCannotMoveInto
File "CvGameUtils", line 67, in unitCannotMoveInto
AttributeError: 'CyUnit' object has no attribute 'getType'
ERR: Python function unitCannotMoveInto failed, module CvGameInterface
File "CvGameUtils", line 67, in unitCannotMoveInto
AttributeError: 'CyUnit' object has no attribute 'getType'
ERR: Python function unitCannotMoveInto failed, module CvGameInterface