mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
fix entity removal
This commit is contained in:
parent
d22948f45c
commit
f42cd9e567
3 changed files with 6 additions and 5 deletions
|
|
@ -296,8 +296,12 @@ static bool process_entity_callback(
|
|||
bool scripting::on_entity_despawn(const EntityDef& def, const Entity& entity) {
|
||||
const auto& script = entity.getScripting();
|
||||
if (script.funcsset.on_despawn) {
|
||||
return process_entity_callback(script.env, "on_despawn", nullptr);
|
||||
process_entity_callback(script.env, "on_despawn", nullptr);
|
||||
}
|
||||
auto L = lua::get_main_thread();
|
||||
lua::get_from(L, "stdcomp", "remove_Entity", true);
|
||||
lua::pushinteger(L, entity.getUID());
|
||||
lua::call(L, 1, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue