reserve "project", "pack", "packid", "root" entry-point names

This commit is contained in:
MihailRis 2025-04-14 19:29:22 +03:00
parent 57330a4235
commit d1fb68eeac

View File

@ -20,7 +20,8 @@ ContentPack ContentPack::createCore(const EnginePaths& paths) {
}
const std::vector<std::string> ContentPack::RESERVED_NAMES = {
"res", "abs", "local", "core", "user", "world", "none", "null"
"res", "abs", "local", "core", "user", "world", "none", "null", "project",
"pack", "packid", "root"
};
contentpack_error::contentpack_error(
@ -114,10 +115,11 @@ ContentPack ContentPack::read(const io::path& folder) {
}
}
if (pack.id == "none")
if (pack.id == "none") {
throw contentpack_error(
pack.id, folder, "content-pack id is not specified"
);
}
checkContentPackId(pack.id, folder);
return pack;