From bd58b28e43f2b7969fcee2d23cf127bfd7e59ca9 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Tue, 10 Jun 2025 10:01:46 -0700 Subject: [PATCH] use newer attack, delete existing attack (#1134) ## Description: Also when a new attack is sent when there's an existing attack, have the new attack delete the existing attack. This causes attack to "reset" and use the entire border when a new attack is sent. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: --- src/core/execution/AttackExecution.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts index bc8c78dff..1926d9991 100644 --- a/src/core/execution/AttackExecution.ts +++ b/src/core/execution/AttackExecution.ts @@ -140,13 +140,11 @@ export class AttackExecution implements Execution { if ( outgoing !== this.attack && outgoing.target() === this.attack.target() && - outgoing.sourceTile() === this.attack.sourceTile() + // Boat attacks (sourceTile is not null) are not combined with other attacks + this.attack.sourceTile() === null ) { - // Existing attack on same target, add troops - outgoing.setTroops(outgoing.troops() + this.attack.troops()); - this.active = false; - this.attack.delete(); - return; + this.attack.setTroops(this.attack.troops() + outgoing.troops()); + outgoing.delete(); } }