Removed usage of BoostAI in enter payload command

This commit is contained in:
Anuken
2026-03-14 02:05:23 -04:00
parent 5fd7f68510
commit c920fe2d21
4 changed files with 9 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ public class UnitCommand extends MappableContent{
mineCommand = new UnitCommand("mine", "production", Binding.unitCommandMine, u -> new MinerAI()){{
refreshOnSelect = true;
}};
enterPayloadCommand = new UnitCommand("enterPayload", "downOpen", Binding.unitCommandEnterPayload, u -> new BoostAI()){{
enterPayloadCommand = new UnitCommand("enterPayload", "downOpen", Binding.unitCommandEnterPayload, null){{
switchToMove = false;
drawTarget = true;
resetTarget = false;

View File

@@ -89,7 +89,7 @@ public class UnitStance extends MappableContent{
}};
ram = new UnitStance("ram", "rightOpen", Binding.unitStanceRam);
boost = new UnitStance("boost", "up", Binding.unitStanceBoost){{
incompatibleCommands.addAll(UnitCommand.rebuildCommand, UnitCommand.repairCommand, UnitCommand.assistCommand);
incompatibleCommands.addAll(UnitCommand.rebuildCommand, UnitCommand.repairCommand, UnitCommand.assistCommand, UnitCommand.enterPayloadCommand);
}};
holdPosition = new UnitStance("holdposition", "effect", Binding.unitStanceHoldPosition);
mineAuto = new UnitStance("mineauto", "settings", null, false);

View File

@@ -16,6 +16,8 @@ public class BoostAI extends AIController{
if(ai.attackTarget != null && unit.within(ai.attackTarget, unit.range())){
unit.command().command(UnitCommand.moveCommand);
}
}else{
unit.updateBoosting(true, true);
}
}
}

View File

@@ -157,7 +157,7 @@ public class CommandAI extends AIController{
commandController.updateUnit();
}else{
defaultBehavior();
if(hasStance(UnitStance.boost) && unit.type.canBoost){
if(shouldBoost() && unit.type.canBoost){
//auto land when near target
if(attackTarget != null && unit.within(attackTarget, unit.range())){
unit.updateBoosting(false);
@@ -171,6 +171,10 @@ public class CommandAI extends AIController{
}
}
protected boolean shouldBoost(){
return hasStance(UnitStance.boost) || command == UnitCommand.enterPayloadCommand;
}
public void clearCommands(){
commandQueue.clear();
targetPos = null;