summaryrefslogtreecommitdiff
path: root/src/world/proposal.js
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-11-12 15:18:29 -0600
committersanine <sanine.not@pm.me>2023-11-12 15:18:29 -0600
commit7825b92ce3be95a0ce1dfea9388adbaadce83b1f (patch)
treeeb1e38561e3aba4b890e666e04d46e4de499658e /src/world/proposal.js
parent95fd952b6d4c496efc0e6236ba2acfcbbeee8ed9 (diff)
fix bugs
Diffstat (limited to 'src/world/proposal.js')
-rw-r--r--src/world/proposal.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/world/proposal.js b/src/world/proposal.js
index 0969540..8baca06 100644
--- a/src/world/proposal.js
+++ b/src/world/proposal.js
@@ -57,6 +57,7 @@ import { pairs, deepEqual } from '../util.js';
// check that two flags objects are compatible
// flags are considered compatible if they do not have any common keys with different values
function flags_compatible(a, b) {
+ if (a === undefined || b === undefined) { return true; }
const keys = [...new Set(Object.keys(a).concat(Object.keys(b)))];
return keys.reduce(
(acc, key) => {
@@ -80,7 +81,7 @@ function lattice_change_conflict(a, b) {
if (
a.x === b.x &&
a.y === b.y &&
- (a.to != b.to || !flags_compatible(a.flags || {}, b.flags || {}))
+ (a.to != b.to || !flags_compatible((a.flags || {}), (b.flags || {})))
) {
// conflict!
return [true, false];