Skip to content

Commit

Permalink
Allow for negative values when decrementing values.
Browse files Browse the repository at this point in the history
  • Loading branch information
davelens committed Dec 12, 2020
1 parent 09a64b7 commit 9a5a105
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
--
* Made it so longer resource labels (19+ characters) are properly word-wrapped
instead of bleeding through the +/- buttons.
* Allow for negative values when decrementing resource values.
3 changes: 1 addition & 2 deletions modules/resources_api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import ResourcesList from "./resources_list.mjs";

export default class ResourcesApi {
decrement(name) {
let value = this.get(name) - 1
this.set(name, value > 0 ? value : 0)
this.set(name, this.get(name) - 1)
}

get(name) {
Expand Down

0 comments on commit 9a5a105

Please sign in to comment.