mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
fix lua stack leak
This commit is contained in:
parent
982c8b132d
commit
e08bfd071b
3 changed files with 13 additions and 1 deletions
|
|
@ -10,6 +10,7 @@
|
|||
#include "../graphics/render/WorldRenderer.hpp"
|
||||
#include "../logic/scripting/scripting.hpp"
|
||||
#include "../objects/Player.hpp"
|
||||
#include "../objects/Entities.hpp"
|
||||
#include "../physics/Hitbox.hpp"
|
||||
#include "../util/stringutil.hpp"
|
||||
#include "../voxels/Block.hpp"
|
||||
|
|
@ -83,6 +84,9 @@ std::shared_ptr<UINode> create_debug_panel(
|
|||
return L"chunks: "+std::to_wstring(level->chunks->chunksCount)+
|
||||
L" visible: "+std::to_wstring(level->chunks->visible);
|
||||
}));
|
||||
panel->add(create_label([=]() {
|
||||
return L"entities: "+std::to_wstring(level->entities->size());
|
||||
}));
|
||||
panel->add(create_label([=](){
|
||||
const auto& vox = player->selection.vox;
|
||||
std::wstringstream stream;
|
||||
|
|
|
|||
|
|
@ -318,6 +318,7 @@ void scripting::on_entities_update() {
|
|||
auto L = lua::get_main_thread();
|
||||
lua::get_from(L, STDCOMP, "update", true);
|
||||
lua::call_nothrow(L, 0, 0);
|
||||
lua::pop(L);
|
||||
}
|
||||
|
||||
void scripting::on_ui_open(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue