diff --git a/src/libs/core/src/internal_functions.cpp b/src/libs/core/src/internal_functions.cpp index 8a5df1cd1..496de7967 100644 --- a/src/libs/core/src/internal_functions.cpp +++ b/src/libs/core/src/internal_functions.cpp @@ -1626,6 +1626,10 @@ DATA *COMPILER::BC_CallIntFunction(uint32_t func_code, DATA *&pVResult, uint32_t } pV->Get(ent); core.EraseEntity(ent); + + // Make sure to clear entity id + ent = invalid_entity; + pV->Set(ent); break; // case FUNC_DEL_EVENT_HANDLER: