Java AI how to get nanoturret to fight without timing out
Posted: 16 Jun 2014, 21:14
Right now I have
The fight order is forgotten when there are no tasks available. When I use /cheat and /team to join the AI, and I issue a fight order, it stays and does not time out.
Code: Select all
public int unitFinished(Unit unit)
{
if(unit.getDef().isBuilder()&&unit.getDef().getBuildDistance()>128){
AIFloat3 location = unit.getPos();
location.x+=50;
unit.fight(location,(short)1, INTEGER.MAX_VALUE);//I've tried 0, -1 and MAX_VALUE, both of which didn't work
}
return 0;
}