minor refactor
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "../../items/ItemDef.h"
|
||||
#include "../../items/Inventory.h"
|
||||
#include "../../logic/BlocksController.h"
|
||||
#include "../../logic/LevelController.h"
|
||||
#include "../../frontend/UiDocument.h"
|
||||
#include "../../engine.h"
|
||||
#include "lua/LuaState.h"
|
||||
@@ -103,11 +104,12 @@ void scripting::process_post_runnables() {
|
||||
}
|
||||
}
|
||||
|
||||
void scripting::on_world_load(Level* level, BlocksController* blocks) {
|
||||
scripting::level = level;
|
||||
void scripting::on_world_load(LevelController* controller) {
|
||||
scripting::level = controller->getLevel();
|
||||
scripting::content = level->content;
|
||||
scripting::indices = level->content->getIndices();
|
||||
scripting::blocks = blocks;
|
||||
scripting::blocks = controller->getBlocksController();
|
||||
scripting::controller = controller;
|
||||
load_script("world.lua");
|
||||
|
||||
for (auto& pack : scripting::engine->getContentPacks()) {
|
||||
@@ -146,6 +148,8 @@ void scripting::on_world_quit() {
|
||||
scripting::level = nullptr;
|
||||
scripting::content = nullptr;
|
||||
scripting::indices = nullptr;
|
||||
scripting::blocks = nullptr;
|
||||
scripting::controller = nullptr;
|
||||
}
|
||||
|
||||
void scripting::on_blocks_tick(const Block* block, int tps) {
|
||||
|
||||
Reference in New Issue
Block a user