mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 17:46:46 +00:00
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: <DISCORD USERNAME>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user