Skip to content

Commit

Permalink
Overwrite invalid cells when typing number
Browse files Browse the repository at this point in the history
  • Loading branch information
x-sheep committed May 11, 2024
1 parent bd4068a commit 84628e6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/variety/portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@
},
posthook: {
qnum: function() {
if (this.qnum !== -1) {
this.setQues(0);
}

if (this.isValidNum()) {
for (var dir in this.adjacent) {
var other = this.adjacent[dir];
Expand All @@ -136,9 +140,12 @@
}
}

// TODO: Actually update the subspace items in the graph instead of rebuilding everything
// TODO: The code below is a workaround to not have to update the graph when portals change.
// Instead, the entire graph will be reconstructed. If this becomes a performance issue for
// puzzle setters, everything below this commment should be removed and the graph needs to
// be updated to support portal changes without leading to a corrupted state.

// Save every line color before rebuilding, then piece it together
/* Save every line color before rebuilding, then piece it back together */
var lines = [];
var linkobjs = this.board.linegraph.components;

Expand Down

0 comments on commit 84628e6

Please sign in to comment.