oops x2
This commit is contained in:
parent
64184e5f1e
commit
dcd0bdfd2b
|
|
@ -3,6 +3,9 @@
|
||||||
+ Explosives Update
|
+ Explosives Update
|
||||||
+ Machines Update
|
+ Machines Update
|
||||||
|
|
||||||
|
[Version 1.1]
|
||||||
|
+ Loopy
|
||||||
|
|
||||||
[Version 1.0.1]
|
[Version 1.0.1]
|
||||||
~ Slowed down Udder
|
~ Slowed down Udder
|
||||||
+ Technical: runAfterLoad() function, pass a function to run after all mods load. See example_mod.js
|
+ Technical: runAfterLoad() function, pass a function to run after all mods load. See example_mod.js
|
||||||
|
|
|
||||||
50
index.html
50
index.html
|
|
@ -3447,6 +3447,16 @@
|
||||||
rotatable: true,
|
rotatable: true,
|
||||||
category: "special",
|
category: "special",
|
||||||
},
|
},
|
||||||
|
"loopy": {
|
||||||
|
color: "#eb3474",
|
||||||
|
behavior: [
|
||||||
|
"XX|M2|M1",
|
||||||
|
"XX|RT%20|M2",
|
||||||
|
"CR:smoke|XX|XX",
|
||||||
|
],
|
||||||
|
rotatable: true,
|
||||||
|
category: "special",
|
||||||
|
},
|
||||||
"smoke_grenade": {
|
"smoke_grenade": {
|
||||||
color: "#2b382c",
|
color: "#2b382c",
|
||||||
behavior: [
|
behavior: [
|
||||||
|
|
@ -5474,35 +5484,33 @@ for (var k = 0; k < b0.split(" AND ").length; k++) {
|
||||||
// If the element has reactions, loop through each one (it is an object), if the value for elem1 or elem2 is not an element and is not null, remove that key
|
// If the element has reactions, loop through each one (it is an object), if the value for elem1 or elem2 is not an element and is not null, remove that key
|
||||||
if (elements[key].reactions) {
|
if (elements[key].reactions) {
|
||||||
for (var reaction in elements[key].reactions) {
|
for (var reaction in elements[key].reactions) {
|
||||||
if (!elements[elements[key].reactions[reaction].elem1] && elements[key].reactions[reaction].elem1 != null) {
|
// If elem1 exists
|
||||||
delete elements[key].reactions[reaction].elem1;
|
if (elements[key].reactions[reaction].elem1) {
|
||||||
}
|
// If elem1 is an array, loop through each element, else check once. Don't delete if it === null
|
||||||
if (!elements[elements[key].reactions[reaction].elem2] && elements[key].reactions[reaction].elem2 != null) {
|
if (Array.isArray(elements[key].reactions[reaction].elem1)) {
|
||||||
delete elements[key].reactions[reaction].elem2;
|
for (var i = 0; i < elements[key].reactions[reaction].elem1.length; i++) {
|
||||||
if (!Array.isArray(elements[key].reactions[reaction].elem1)) {
|
if (elements[key].reactions[reaction].elem1[i] && !elements[elements[key].reactions[reaction].elem1[i]]) {
|
||||||
|
elements[key].reactions[reaction].elem1.splice(i,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (elements[key].reactions[reaction].elem1 && !elements[elements[key].reactions[reaction].elem1]) {
|
||||||
delete elements[key].reactions[reaction].elem1;
|
delete elements[key].reactions[reaction].elem1;
|
||||||
}
|
}
|
||||||
else { // Do the same for each element in the array
|
|
||||||
for (var i = 0; i < elements[key].reactions[reaction].elem1.length; i++) {
|
|
||||||
if (!elements[elements[key].reactions[reaction].elem1[i]] && elements[key].reactions[reaction].elem1[i] != null) {
|
|
||||||
elements[key].reactions[reaction].elem1.splice(i,1);
|
|
||||||
i--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!elements[elements[key].reactions[reaction].elem2] && elements[key].reactions[reaction].elem2 != null) {
|
// If elem2 exists
|
||||||
if (!Array.isArray(elements[key].reactions[reaction].elem2)) {
|
if (elements[key].reactions[reaction].elem2) {
|
||||||
delete elements[key].reactions[reaction].elem2;
|
// If elem2 is an array, loop through each element, else check once. Don't delete if it === null
|
||||||
}
|
if (Array.isArray(elements[key].reactions[reaction].elem2)) {
|
||||||
else {
|
|
||||||
for (var i = 0; i < elements[key].reactions[reaction].elem2.length; i++) {
|
for (var i = 0; i < elements[key].reactions[reaction].elem2.length; i++) {
|
||||||
if (!elements[elements[key].reactions[reaction].elem2[i]] && elements[key].reactions[reaction].elem2[i] != null) {
|
if (elements[key].reactions[reaction].elem2[i] && !elements[elements[key].reactions[reaction].elem2[i]]) {
|
||||||
elements[key].reactions[reaction].elem2.splice(i,1);
|
elements[key].reactions[reaction].elem2.splice(i,1);
|
||||||
i--;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (elements[key].reactions[reaction].elem2 && !elements[elements[key].reactions[reaction].elem2]) {
|
||||||
|
delete elements[key].reactions[reaction].elem2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue