mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 10:24:16 +00:00
Update PlayerImpl.ts (#1079)
## Description: The removeTroops function works with the given parameter value of 1. ## 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> _bjkim_
This commit is contained in:
@@ -698,7 +698,7 @@ export class PlayerImpl implements Player {
|
||||
this._troops += toInt(troops);
|
||||
}
|
||||
removeTroops(troops: number): number {
|
||||
if (troops <= 1) {
|
||||
if (troops <= 0) {
|
||||
return 0;
|
||||
}
|
||||
const toRemove = minInt(this._troops, toInt(troops));
|
||||
|
||||
Reference in New Issue
Block a user