mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
fix: pack environment not passed to components
This commit is contained in:
parent
c0d326061e
commit
69cf4c1c04
4 changed files with 19 additions and 4 deletions
|
|
@ -492,6 +492,7 @@ void ContentLoader::loadScripts(Content& content) {
|
|||
load_scripts(content, content.items);
|
||||
|
||||
for (const auto& [packid, runtime] : content.getPacks()) {
|
||||
auto env = runtime->getEnvironment();
|
||||
const auto& pack = runtime->getInfo();
|
||||
const auto& folder = pack.folder;
|
||||
|
||||
|
|
@ -500,9 +501,10 @@ void ContentLoader::loadScripts(Content& content) {
|
|||
|
||||
// Load entity components
|
||||
io::path componentsDir = folder / "scripts/components";
|
||||
foreach_file(componentsDir, [&pack](const io::path& file) {
|
||||
foreach_file(componentsDir, [&pack, env](const io::path& file) {
|
||||
auto name = pack.id + ":" + file.stem();
|
||||
scripting::load_entity_component(
|
||||
env,
|
||||
name,
|
||||
file,
|
||||
pack.id + ":scripts/components/" + file.name()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue