aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-01-18 23:41:48 -0500
committerHolden Rohrer <hr@hrhr.dev>2020-01-18 23:41:48 -0500
commit7078cb41929b7babeeea0b912181feb2f544ebf5 (patch)
tree0f2246748ae3ebd720ddcfb736ec51ddf76b0783
parenta4279d86918c0ec47300b00df2a3fd06e77aab30 (diff)
simplified and corrected protectArea diffing
-rw-r--r--examples/jarvis.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/jarvis.js b/examples/jarvis.js
index fb3a999..8abd9c9 100644
--- a/examples/jarvis.js
+++ b/examples/jarvis.js
@@ -89,10 +89,9 @@ function protectArea(send, tiles, locs){
loc = vec.tileToChar(loc);
if (ri(ctrl, [loc, vec.add(loc, tilesize)])){
// Write diffs from the tile
- let inter = notif.copy(); // Acts as a window for tile (only see relevant data)
- inter.comb(tile, comb.unmask);
- let diff = notif.copy(); // Actually diffs notify with the errant text
- diff.comb(inter, comb.sub);
+ let diff = notif.copy(); // Acts as a window for tile (only see relevant data)
+ diff.comb(tile, comb.flip(comb.unmask));
+ diff.comb(tile, comb.sub);
writes.enqueue(diff.towrite())
// Mask the tile
let newtile = notif.copy();