Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/js/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ function rulesToArray(state) {

}

for (i=0;i<rules4.length;i++){
for (var i=0;i<rules4.length;i++){
makeSpawnedObjectsStationary(state,rules4[i],rule.lineNumber);
}
state.rules = rules4;
Expand Down Expand Up @@ -2789,4 +2789,4 @@ function qualifyURL(url) {
var a = document.createElement('a');
a.href = url;
return a.href;
}
}
10 changes: 5 additions & 5 deletions src/js/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ function applyDiff(diff, level_objects) {
if (copy_length===0){
break;//tail of buffer is all 0s
}
for (j=0;j<copy_length;j++){
for (var j=0;j<copy_length;j++){
level_objects[start_index+j]=diff.dat[index+2+j];
}
index += 2 + copy_length;
Expand Down Expand Up @@ -1081,7 +1081,7 @@ function DoUndo(force,ignoreDuplicates) {
function getPlayerPositions() {
var result=[];
var playerMask = state.playerMask;
for (i=0;i<level.n_tiles;i++) {
for (var i=0;i<level.n_tiles;i++) {
level.getCellInto(i,_o11);
if (playerMask.anyBitsInCommon(_o11)) {
result.push(i);
Expand Down Expand Up @@ -2562,7 +2562,7 @@ function processInput(dir,dontDoWin,dontModify) {
}


bannedGroup = [];
level.bannedGroup = [];
level.commandQueue=[];
level.commandQueueSourceRules=[];
var startRuleGroupIndex=0;
Expand Down Expand Up @@ -2592,8 +2592,8 @@ function processInput(dir,dontDoWin,dontModify) {



applyRules(state.rules, state.loopPoint, startRuleGroupIndex, bannedGroup);
var shouldUndo = resolveMovements(level,bannedGroup);
applyRules(state.rules, state.loopPoint, startRuleGroupIndex, level.bannedGroup);
var shouldUndo = resolveMovements(level, level.bannedGroup);

if (shouldUndo) {
rigidloop=true;
Expand Down
12 changes: 8 additions & 4 deletions src/js/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ var codeMirrorFn = function() {
var soundsCopy = [];
var levelsCopy = [];
var winConditionsCopy = [];
var rulesCopy = [];

for (var i = 0; i < state.legend_synonyms.length; i++) {
legend_synonymsCopy.push(state.legend_synonyms[i].concat([]));
Expand All @@ -270,6 +271,9 @@ var codeMirrorFn = function() {
for (var i = 0; i < state.winconditions.length; i++) {
winConditionsCopy.push(state.winconditions[i].concat([]));
}
for (var i = 0; i < state.rules.length; i++) {
rulesCopy.push(state.rules[i].concat([]));
}

var original_case_namesCopy = Object.assign({},state.original_case_names);

Expand All @@ -294,7 +298,7 @@ var codeMirrorFn = function() {

sounds: soundsCopy,

rules: state.rules.concat([]),
rules: rulesCopy,

names: state.names.concat([]),

Expand Down Expand Up @@ -1110,7 +1114,7 @@ var codeMirrorFn = function() {
if (sol)
{
if (stream.match(/[\p{Z}\s]*message\b[\p{Z}\s]*/u, true)) {
state.tokenIndex = 1;//1/2 = message/level
state.tokenIndex = -4;//-4/2 = message/level
var newdat = ['\n', mixedCase.slice(stream.pos).trim(),state.lineNumber];
if (state.levels[state.levels.length - 1].length == 0) {
state.levels.splice(state.levels.length - 1, 0, newdat);
Expand All @@ -1120,7 +1124,7 @@ var codeMirrorFn = function() {
return 'MESSAGE_VERB';//a duplicate of the previous section as a legacy thing for #589
} else if (stream.match(/[\p{Z}\s]*message[\p{Z}\s]*/u, true)) {//duplicating previous section because of #589
logWarning("You probably meant to put a space after 'message' innit. That's ok, I'll still interpret it as a message, but you probably want to put a space there.",state.lineNumber);
state.tokenIndex = 1;//1/2 = message/level
state.tokenIndex = -4;//-4/2 = message/level
var newdat = ['\n', mixedCase.slice(stream.pos).trim(),state.lineNumber];
if (state.levels[state.levels.length - 1].length == 0) {
state.levels.splice(state.levels.length - 1, 0, newdat);
Expand Down Expand Up @@ -1158,7 +1162,7 @@ var codeMirrorFn = function() {
}
}
} else {
if (state.tokenIndex == 1) {
if (state.tokenIndex == -4) {
stream.skipToEnd();
return 'MESSAGE';
}
Expand Down