mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
fixes
This commit is contained in:
parent
89a6747c21
commit
b035621249
5 changed files with 11 additions and 38 deletions
|
|
@ -334,7 +334,7 @@ void ContentLoader::load() {
|
|||
|
||||
fixPackIndices();
|
||||
|
||||
loadMainScript(*runtime);
|
||||
loadContentScript(*runtime);
|
||||
|
||||
auto folder = pack->folder;
|
||||
|
||||
|
|
@ -342,8 +342,6 @@ void ContentLoader::load() {
|
|||
EnginePaths::CONFIG_DEFAULTS.string()
|
||||
);
|
||||
|
||||
scripting::on_content_initialization();
|
||||
|
||||
// Load world generators
|
||||
io::path generatorsDir = folder / "generators";
|
||||
foreach_file(generatorsDir, [this](const io::path& file) {
|
||||
|
|
@ -466,17 +464,16 @@ void ContentLoader::reloadScript(const Content& content, ItemDef& item) {
|
|||
load_script(content, item);
|
||||
}
|
||||
|
||||
void ContentLoader::loadMainScript(ContentPackRuntime& runtime) {
|
||||
void ContentLoader::loadContentScript(ContentPackRuntime& runtime) {
|
||||
const auto& pack = runtime.getInfo();
|
||||
const auto& folder = pack.folder;
|
||||
io::path scriptFile = folder / "scripts/main.lua";
|
||||
io::path scriptFile = folder / "scripts/content.lua";
|
||||
if (io::is_regular_file(scriptFile)) {
|
||||
scripting::load_main_script(
|
||||
scripting::load_content_script(
|
||||
runtime.getEnvironment(),
|
||||
pack.id,
|
||||
scriptFile,
|
||||
pack.id + ":scripts/main.lua",
|
||||
runtime.mainfuncsset
|
||||
pack.id + ":scripts/content.lua"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue