Skip to content

Commit ff13c3e

Browse files
committed
Fixing molang script parsing
1 parent 20d4245 commit ff13c3e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Molang/MolangSet.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,16 @@ export namespace MolangFullSet {
142142

143143
for (let I = 0; I < keys.length; I++) {
144144
const key = keys[I];
145-
const value = script.variables[key];
146-
147-
if (typeof key === "string" && typeof value === "string") {
148-
addTo.variables.defined.push(key);
145+
if (typeof key !== "string") {
146+
continue;
147+
}
148+
const index = key.indexOf(".");
149+
if (index < 0) {
150+
continue;
151+
}
152+
const id = key.substring(index + 1);
153+
if (id && id.length > 0) {
154+
addTo.variables.defined.push(id);
149155
}
150156
}
151157
}

0 commit comments

Comments
 (0)