reduce redundancy
This commit is contained in:
@@ -514,11 +514,11 @@ void scripting::load_item_script(const scriptenv& senv, const std::string& prefi
|
||||
funcsset.on_block_break_by = register_event(env, "on_block_break_by", prefix+".blockbreakby");
|
||||
}
|
||||
|
||||
void scripting::load_entity_component(const scriptenv& penv, const std::string& name, const fs::path& file) {
|
||||
void scripting::load_entity_component(const std::string& name, const fs::path& file) {
|
||||
auto L = lua::get_main_thread();
|
||||
std::string src = files::read_string(file);
|
||||
logger.info() << "script (component) " << file.u8string();
|
||||
lua::loadbuffer(L, *penv, src, file.u8string());
|
||||
lua::loadbuffer(L, 0, src, file.u8string());
|
||||
lua::store_in(L, lua::CHUNKS_TABLE, name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user