PR bugfixes

This commit is contained in:
Anuken
2026-08-31 20:40:14 -04:00
parent df06d44c19
commit 87d27b3070
3 changed files with 8 additions and 8 deletions
+3 -4
View File
@@ -23,7 +23,7 @@ public class CommandAI extends AIController{
public Seq<Position> commandQueue = new Seq<>(5);
public @Nullable Vec2 targetPos;
public @Nullable Building targetBuild;
public @Nullable Building targetBuild;
public @Nullable Teamc attackTarget;
/** Group of units that were all commanded to reach the same point. */
public @Nullable UnitGroup group;
@@ -343,8 +343,7 @@ public class CommandAI extends AIController{
}else{
var result = controlPath.getPathPosition(unit, movePos, isSolidPayload ? movePos : targetPos);
if(!isSolidPayload)
unreachable = result.unreachable;
unreachable = result.unreachable;
move &= result.move && (!blockingUnit || timeSpentBlocked > maxBlockTime);
if(result.move) vecOut.set(result.dest);
@@ -530,7 +529,7 @@ public class CommandAI extends AIController{
@Override
public void hit(Bullet bullet){
if(unit.team.isAI() &&
if(unit.team.isAI() &&
//excluding bullets
(!(bullet.owner instanceof Bullet) && bullet.owner instanceof Teamc teamc) && teamc.team() != unit.team && attackTarget == null &&
//can only counter-attack every few seconds to prevent rapidly changing targets
-2
View File
@@ -114,8 +114,6 @@ public class Block extends UnlockableContent implements Senseable{
public boolean solidifes;
/** if true, this counts as a non-solid block to this team. */
public boolean teamPassable;
/** if true, units will attempt to pathfind to this block even if its tile is normally impassable. */
public boolean pathfindTarget = false;
/** if true, this block cannot be hit by bullets unless explicitly targeted. */
public boolean underBullets;
/** whether this is rotatable */
@@ -101,8 +101,10 @@ public class PayloadBlock extends Block{
@Override
public boolean canControlSelect(Unit unit){
return !unit.spawnedByCore && unit.type.allowedInPayloads && this.payload == null && acceptUnitPayload(unit) &&
(unit.isGrounded() && !unit.type.allowLegStep && solid) ? unit.within(this, size * tilesize * 0.7f + unit.hitSize / 2f) : unit.tileOn() != null && unit.tileOn().build == this;
if(unit.spawnedByCore || !unit.type.allowedInPayloads || this.payload != null || !acceptUnitPayload(unit)) return false;
//ground units can be accepted when they are near solid blocks
return (unit.isGrounded() && !unit.type.allowLegStep && solid) ? unit.within(this, size * tilesize * 0.7f + unit.hitSize / 2f) : unit.tileOn() != null && unit.tileOn().build == this;
}
@Override
@@ -118,6 +120,7 @@ public class PayloadBlock extends Block{
return this.payload == null;
}
@Override
public void handlePayload(Building source, Payload payload, @Nullable Unit unit){
if(unit != null){
float clampPos = size * tilesize * 0.7f + unit.hitSize / 2f;