From 7078cb41929b7babeeea0b912181feb2f544ebf5 Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Sat, 18 Jan 2020 23:41:48 -0500
Subject: simplified and corrected protectArea diffing
---
examples/jarvis.js | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
(limited to 'examples')
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();
--
cgit