sam is red when reloading (#268)

This commit is contained in:
Ilan Schemoul
2025-03-18 14:16:02 -07:00
committed by GitHub
parent a402242f11
commit 24f25d677a
10 changed files with 96 additions and 30 deletions
+8 -1
View File
@@ -92,8 +92,15 @@ export class SAMLauncherExecution implements Execution {
);
})[0] ?? null;
const cooldown =
this.lastMissileAttack != 0 &&
this.mg.ticks() - this.lastMissileAttack <= this.missileAttackRate;
if (this.post.isSamCooldown() != cooldown) {
this.post.setSamCooldown(cooldown);
}
if (this.target != null) {
if (this.mg.ticks() - this.lastMissileAttack > this.missileAttackRate) {
if (!this.post.isSamCooldown()) {
this.lastMissileAttack = this.mg.ticks();
this.mg.addExecution(
new SAMMissileExecution(