mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
minor refactor
This commit is contained in:
parent
81641be024
commit
9df82ec0de
5 changed files with 37 additions and 11 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue