From 8b8c42ea1690337841f86000307071e2dc45d4b7 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Thu, 7 Nov 2024 19:40:38 -0800 Subject: [PATCH] bugfix: boat attack now donates troops instead of attacking when alliance is created during boat attack --- src/core/execution/BoatAttackExecution.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/execution/BoatAttackExecution.ts b/src/core/execution/BoatAttackExecution.ts index fabf95380..23ae6bf4c 100644 --- a/src/core/execution/BoatAttackExecution.ts +++ b/src/core/execution/BoatAttackExecution.ts @@ -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