Remove ||=, which is also really new!
This commit is contained in:
parent
ad615e5caf
commit
362c18d6e2
11
js/game.js
11
js/game.js
@ -1013,14 +1013,17 @@ export class Level {
|
|||||||
|
|
||||||
let type = TILE_TYPES[name];
|
let type = TILE_TYPES[name];
|
||||||
if (type.is_key) {
|
if (type.is_key) {
|
||||||
actor.keyring ||= {};
|
if (! actor.keyring) {
|
||||||
actor.keyring[name] ||= 0;
|
actor.keyring = {};
|
||||||
actor.keyring[name] += 1;
|
}
|
||||||
|
actor.keyring[name] = (actor.keyring[name] ?? 0) + 1;
|
||||||
this.pending_undo.push(() => actor.keyring[name] -= 1);
|
this.pending_undo.push(() => actor.keyring[name] -= 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// tool, presumably
|
// tool, presumably
|
||||||
actor.toolbelt ||= [];
|
if (! actor.toolbelt) {
|
||||||
|
actor.toolbelt = [];
|
||||||
|
}
|
||||||
actor.toolbelt.push(name);
|
actor.toolbelt.push(name);
|
||||||
this.pending_undo.push(() => actor.toolbelt.pop());
|
this.pending_undo.push(() => actor.toolbelt.pop());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user