Avoid ??= for now, it's extremely new
This commit is contained in:
parent
72a44429af
commit
c8a24d0e4b
@ -1005,14 +1005,14 @@ export class Level {
|
|||||||
|
|
||||||
let type = TILE_TYPES[name];
|
let type = TILE_TYPES[name];
|
||||||
if (type.is_key) {
|
if (type.is_key) {
|
||||||
actor.keyring ??= {};
|
actor.keyring ||= {};
|
||||||
actor.keyring[name] ??= 0;
|
actor.keyring[name] ||= 0;
|
||||||
actor.keyring[name] += 1;
|
actor.keyring[name] += 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 ??= [];
|
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