mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 22:41:49 +00:00
fix incomplete content reset
This commit is contained in:
parent
6403757354
commit
61af8ba943
3 changed files with 7 additions and 0 deletions
|
|
@ -60,6 +60,7 @@ void ContentControl::resetContent() {
|
||||||
}
|
}
|
||||||
paths.resPaths = ResPaths(resRoots);
|
paths.resPaths = ResPaths(resRoots);
|
||||||
content.reset();
|
content.reset();
|
||||||
|
scripting::on_content_reset();
|
||||||
|
|
||||||
contentPacks.clear();
|
contentPacks.clear();
|
||||||
contentPacks = manager->getAll(basePacks);
|
contentPacks = manager->getAll(basePacks);
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,11 @@ void scripting::on_content_load(Content* content) {
|
||||||
load_script("stdcmd.lua", true);
|
load_script("stdcmd.lua", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void scripting::on_content_reset() {
|
||||||
|
scripting::content = nullptr;
|
||||||
|
scripting::indices = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void scripting::on_world_load(LevelController* controller) {
|
void scripting::on_world_load(LevelController* controller) {
|
||||||
scripting::level = controller->getLevel();
|
scripting::level = controller->getLevel();
|
||||||
scripting::blocks = controller->getBlocksController();
|
scripting::blocks = controller->getBlocksController();
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ namespace scripting {
|
||||||
void initialize(Engine* engine);
|
void initialize(Engine* engine);
|
||||||
|
|
||||||
void on_content_load(Content* content);
|
void on_content_load(Content* content);
|
||||||
|
void on_content_reset();
|
||||||
|
|
||||||
bool register_event(
|
bool register_event(
|
||||||
int env, const std::string& name, const std::string& id
|
int env, const std::string& name, const std::string& id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue