Fixed load block command not arriving on target
This commit is contained in:
@@ -29,6 +29,8 @@ public class UnitCommand extends MappableContent{
|
||||
public boolean drawTarget = false;
|
||||
/** Whether to reset targets when switching to or from this command. */
|
||||
public boolean resetTarget = true;
|
||||
/** */
|
||||
public boolean exactArrival = false;
|
||||
/** Key to press for this command. */
|
||||
public @Nullable Binding keybind = null;
|
||||
|
||||
@@ -101,6 +103,7 @@ public class UnitCommand extends MappableContent{
|
||||
switchToMove = false;
|
||||
drawTarget = true;
|
||||
resetTarget = false;
|
||||
exactArrival = true;
|
||||
}};
|
||||
unloadPayloadCommand = new UnitCommand("unloadPayload", "download", Binding.unit_command_unload_payload, null){{
|
||||
switchToMove = false;
|
||||
|
||||
@@ -40,7 +40,7 @@ public class CommandAI extends AIController{
|
||||
/** Stance, usually related to firing mode. */
|
||||
public UnitStance stance = UnitStance.shoot;
|
||||
/** Current command this unit is following. */
|
||||
public @Nullable UnitCommand command;
|
||||
public UnitCommand command = UnitCommand.moveCommand;
|
||||
/** Current controller instance based on command. */
|
||||
protected @Nullable AIController commandController;
|
||||
/** Last command type assigned. Used for detecting command changes. */
|
||||
@@ -291,7 +291,7 @@ public class CommandAI extends AIController{
|
||||
}
|
||||
|
||||
//reached destination, end pathfinding
|
||||
if(attackTarget == null && unit.within(vecMovePos, Math.max(5f, unit.hitSize / 2f))){
|
||||
if(attackTarget == null && unit.within(vecMovePos, command.exactArrival && commandQueue.size == 0 ? 1f : Math.max(5f, unit.hitSize / 2f))){
|
||||
finishPath();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user