mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-23 16:36:51 +00:00
Change how canceled attacks are recorded (#1480)
## Description: Minor fix: The `retreat()` function is called everytime the troops have to come back home: - alliance between the belligerents - cluster / player conquest - canceled attack Each of those cases are recorded as "canceled" but only the actually canceled attacks should be recorded as such. ## 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 have read and accepted the CLA aggreement (only required once). ## Please put your Discord username so you can be contacted if a bug or regression is found: IngloriousTom
This commit is contained in:
@@ -185,8 +185,11 @@ export class AttackExecution implements Execution {
|
||||
this.attack.delete();
|
||||
this.active = false;
|
||||
|
||||
// Record stats
|
||||
this.mg.stats().attackCancel(this._owner, this.target, survivors);
|
||||
// Not all retreats are canceled attacks
|
||||
if (this.attack.retreated()) {
|
||||
// Record stats
|
||||
this.mg.stats().attackCancel(this._owner, this.target, survivors);
|
||||
}
|
||||
}
|
||||
|
||||
tick(ticks: number) {
|
||||
|
||||
Reference in New Issue
Block a user