Remove gold from dead players (#1450)

Fixes #1519 

## Description:
Currently if a player is killed via a nuke, they keep their gold despite
being eliminated and other players have no way to access that gold as
there is no territory to conquer. This PR fixes this by removing gold
from dead players.

This doesn't affect gameplay itself, because that gold was already
inaccessible. It'll just be clearer to the remaining players now.

<img width="1566" height="827" alt="Zrzut ekranu 2025-07-16 210908"
src="https://github.com/user-attachments/assets/438081e5-c145-4691-a36c-92ceb1049469"
/>
^ This is what this PR fixes

## 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:
aceralex
This commit is contained in:
djmrFunnyMan
2025-08-02 07:22:12 +02:00
committed by GitHub
parent 850b0f3d16
commit 4626f4dc4a
+3 -1
View File
@@ -41,7 +41,9 @@ export class PlayerExecution implements Execution {
});
if (!this.player.isAlive()) {
// Player has no tiles, delete any remaining units
// Player has no tiles, delete any remaining units and gold
const gold = this.player.gold();
this.player.removeGold(gold);
this.player.units().forEach((u) => {
if (
u.type() !== UnitType.AtomBomb &&