mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +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
|
|
@ -708,12 +708,15 @@ void scripting::load_content_script(
|
|||
}
|
||||
|
||||
void scripting::load_entity_component(
|
||||
const std::string& name, const io::path& file, const std::string& fileName
|
||||
const scriptenv& env,
|
||||
const std::string& name,
|
||||
const io::path& file,
|
||||
const std::string& fileName
|
||||
) {
|
||||
auto L = lua::get_main_state();
|
||||
std::string src = io::read_string(file);
|
||||
logger.info() << "script (component) " << file.string();
|
||||
lua::loadbuffer(L, 0, src, fileName);
|
||||
lua::loadbuffer(L, *env, src, fileName);
|
||||
lua::store_in(L, lua::CHUNKS_TABLE, name);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue