Log the name of entities that can't be added
This commit is contained in:
parent
476d65034f
commit
2422c202d3
@ -641,8 +641,11 @@ int ModApiEnvMod::l_add_entity(lua_State *L)
|
|||||||
ServerActiveObject *obj = new LuaEntitySAO(env, pos, name, staticdata);
|
ServerActiveObject *obj = new LuaEntitySAO(env, pos, name, staticdata);
|
||||||
int objectid = env->addActiveObject(obj);
|
int objectid = env->addActiveObject(obj);
|
||||||
// If failed to add, return nothing (reads as nil)
|
// 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;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// If already deleted (can happen in on_activate), return nil
|
// If already deleted (can happen in on_activate), return nil
|
||||||
if (obj->isGone())
|
if (obj->isGone())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user