Avoid ??= for now, it's extremely new

This commit is contained in:
Eevee (Evelyn Woods) 2020-09-20 00:30:07 -06:00
parent 72a44429af
commit c8a24d0e4b

View File

@ -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());
} }