bugfix: boat attack now donates troops instead of attacking when alliance is created during boat attack

This commit is contained in:
evanpelle
2024-11-07 19:40:38 -08:00
parent 7ab91c9520
commit 8b8c42ea16
+6 -2
View File
@@ -122,8 +122,12 @@ export class BoatAttackExecution implements Execution {
this.active = false
return
}
this.attacker.conquer(this.dst)
this.mg.addExecution(new AttackExecution(this.troops, this.attacker.id(), this.targetID, this.dst.cell(), null, false))
if (this.target.isPlayer() && this.attacker.isAlliedWith(this.target)) {
this.target.addTroops(this.troops)
} else {
this.attacker.conquer(this.dst)
this.mg.addExecution(new AttackExecution(this.troops, this.attacker.id(), this.targetID, this.dst.cell(), null, false))
}
this.boat.delete()
this.active = false
return