Fix incorrect display of ability to upgrade enemy units (#2308)

## Description:

Fixes #2135.
Adds an owner check to canUpgradeUnit to prevent enemy units from
seemingly being able to be upgraded when Ctrl+clicked on

## 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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Lavodan
This commit is contained in:
Lavodan
2025-10-27 22:13:05 +01:00
committed by GitHub
parent 4a9a19631e
commit cb744b49fc
+3
View File
@@ -902,6 +902,9 @@ export class PlayerImpl implements Player {
if (this._gold < this.mg.config().unitInfo(unit.type()).cost(this)) {
return false;
}
if (unit.owner() !== this) {
return false;
}
return true;
}