Skip to content

Commit 1f08775

Browse files
author
Bytekeeper
committed
Prevent agents from acting if locked down or in stasis
1 parent 42689e6 commit 1f08775

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/main/java/org/bk/ass/AttackerBehavior.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public boolean simUnit(
1919
if (agent.cooldown > agent.maxCooldown - agent.stopFrames) {
2020
return true;
2121
}
22-
if (agent.isLockeddown || agent.isStasised) return false;
2322

2423
Agent selectedEnemy = null;
2524
Weapon selectedWeapon = null;

src/main/java/org/bk/ass/Simulator.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,18 @@ private void resetUnits() {
152152
private boolean step() {
153153
boolean simRunning = false;
154154
for (int i = playerA.size() - 1; i >= 0; i--) {
155-
simRunning |= playerABehavior.simUnit(playerA.get(i), playerA, playerB);
155+
Agent agent = playerA.get(i);
156+
simRunning |=
157+
agent.isLockeddown
158+
|| agent.isStasised
159+
|| playerABehavior.simUnit(agent, playerA, playerB);
156160
}
157161
for (int i = playerB.size() - 1; i >= 0; i--) {
158-
simRunning |= playerBBehavior.simUnit(playerB.get(i), playerB, playerA);
162+
Agent agent = playerB.get(i);
163+
simRunning |=
164+
agent.isLockeddown
165+
|| agent.isStasised
166+
|| playerBBehavior.simUnit(agent, playerB, playerA);
159167
}
160168
removeDead(playerA);
161169
removeDead(playerB);

0 commit comments

Comments
 (0)