Fix some oopsies
This commit is contained in:
parent
a8c9b1490d
commit
85c12d034a
@ -166,8 +166,9 @@ async function validateMapAsset(assetId, game) {
|
|||||||
errors.push(`The root part of your model is a \`${root.ClassName}\`, it needs to be a \`Model\` instead.`);
|
errors.push(`The root part of your model is a \`${root.ClassName}\`, it needs to be a \`Model\` instead.`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ((game === "bhop" || game === "surf") && !root.Name.startsWith(game + "_")) {
|
const prefix = (game === "deathrun") ? "dr" : game;
|
||||||
errors.push(`Your root model's name is \`${root.Name}\`, its name must start with \`${game}_\`.`);
|
if (!root.Name.startsWith(prefix + "_")) {
|
||||||
|
errors.push(`Your root model's name is \`${root.Name}\`, its name must start with \`${prefix}_\`.`);
|
||||||
}
|
}
|
||||||
if (!/^[a-z0-9_]*$/.test(root.Name)) {
|
if (!/^[a-z0-9_]*$/.test(root.Name)) {
|
||||||
errors.push(`Your root model's name is \`${root.Name}\` which contains invalid characters. It must only contain lowercase alphanumeric characters separated by underscores.`);
|
errors.push(`Your root model's name is \`${root.Name}\` which contains invalid characters. It must only contain lowercase alphanumeric characters separated by underscores.`);
|
||||||
@ -207,8 +208,8 @@ async function validateMapAsset(assetId, game) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Why does ModuleScript not inherit from Script, and/or why does BaseScript not have a Source property?
|
// Why does ModuleScript not inherit from Script, and/or why does BaseScript not have a Source property?
|
||||||
const illegalScript = root.FindFirstChildOfClass("Script", (script) => sourceHasIllegalKeywords(script.Source));
|
const illegalScript = root.FindFirstDescendantOfClass("Script", (script) => sourceHasIllegalKeywords(script.Source));
|
||||||
const illegalModuleScript = root.FindFirstChildOfClass("ModuleScript", (script) => sourceHasIllegalKeywords(script.Source));
|
const illegalModuleScript = root.FindFirstDescendantOfClass("ModuleScript", (script) => sourceHasIllegalKeywords(script.Source));
|
||||||
if (illegalScript || illegalModuleScript) {
|
if (illegalScript || illegalModuleScript) {
|
||||||
errors.push("Your map has a `Script` that contains the keyword `getfenv` or `require`. You must remove these.");
|
errors.push("Your map has a `Script` that contains the keyword `getfenv` or `require`. You must remove these.");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user