1
0
Fork 0

Log the name of entities that can't be added

main-2-0-4
luk3yx 2023-06-23 20:29:12 +12:00
parent 476d65034f
commit 2422c202d3
1 changed files with 4 additions and 1 deletions

View File

@ -641,8 +641,11 @@ int ModApiEnvMod::l_add_entity(lua_State *L)
ServerActiveObject *obj = new LuaEntitySAO(env, pos, name, staticdata);
int objectid = env->addActiveObject(obj);
// If failed to add, return nothing (reads as nil)
if(objectid == 0)
if(objectid == 0) {
errorstream << "Failed to add entity " << name << " at " << PP(pos)
<< std::endl;
return 0;
}
// If already deleted (can happen in on_activate), return nil
if (obj->isGone())