mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
fixes
This commit is contained in:
parent
62600318d7
commit
52e60c979b
3 changed files with 51 additions and 37 deletions
|
|
@ -25,6 +25,7 @@ Engine* scripting::engine = nullptr;
|
|||
lua::LuaState* scripting::state = nullptr;
|
||||
Level* scripting::level = nullptr;
|
||||
const Content* scripting::content = nullptr;
|
||||
const ContentIndices* scripting::indices = nullptr;
|
||||
BlocksController* scripting::blocks = nullptr;
|
||||
|
||||
void load_script(fs::path name) {
|
||||
|
|
@ -77,6 +78,7 @@ wstringconsumer scripting::create_wstring_consumer(
|
|||
void scripting::on_world_load(Level* level, BlocksController* blocks) {
|
||||
scripting::level = level;
|
||||
scripting::content = level->content;
|
||||
scripting::indices = level->content->getIndices();
|
||||
scripting::blocks = blocks;
|
||||
load_script("world.lua");
|
||||
|
||||
|
|
@ -103,6 +105,7 @@ void scripting::on_world_quit() {
|
|||
}
|
||||
scripting::level = nullptr;
|
||||
scripting::content = nullptr;
|
||||
scripting::indices = nullptr;
|
||||
}
|
||||
|
||||
void scripting::on_blocks_tick(const Block* block, int tps) {
|
||||
|
|
@ -224,5 +227,6 @@ void scripting::close() {
|
|||
|
||||
state = nullptr;
|
||||
content = nullptr;
|
||||
indices = nullptr;
|
||||
level = nullptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue