// This needs to be ran for attachments too
ServerActiveObject::setBasePosition(position);
- m_env->updateActiveObject(this);
- m_position_not_sent = true;
+
+ // Updating is not wanted/required for player migration
+ if (m_env) {
+ m_env->updateActiveObject(this);
+ m_position_not_sent = true;
+ }
}
void PlayerSAO::setPos(const v3f &pos)
warningstream << message;
if (L) { // L can be NULL if we get called from scripting_game.cpp
lua_Debug ar;
- FATAL_ERROR_IF(!lua_getstack(L, 2, &ar), "lua_getstack() failed");
+
+ if (!lua_getstack(L, 2, &ar))
+ FATAL_ERROR_IF(!lua_getstack(L, 1, &ar), "lua_getstack() failed");
FATAL_ERROR_IF(!lua_getinfo(L, "Sl", &ar), "lua_getinfo() failed");
warningstream << " (at " << ar.short_src << ":" << ar.currentline << ")";
}