forked from Mirrorlandia_minetest/minetest
Fix segfault in player migration and crash in log_deprecated
Makes log_deprecated work when triggered from no function
This commit is contained in:
parent
a01a9ca24c
commit
a1598e1b83
@ -1166,8 +1166,12 @@ void PlayerSAO::setBasePosition(const v3f &position)
|
|||||||
|
|
||||||
// This needs to be ran for attachments too
|
// This needs to be ran for attachments too
|
||||||
ServerActiveObject::setBasePosition(position);
|
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)
|
void PlayerSAO::setPos(const v3f &pos)
|
||||||
|
@ -153,7 +153,9 @@ void log_deprecated(lua_State *L, const std::string &message)
|
|||||||
warningstream << message;
|
warningstream << message;
|
||||||
if (L) { // L can be NULL if we get called from scripting_game.cpp
|
if (L) { // L can be NULL if we get called from scripting_game.cpp
|
||||||
lua_Debug ar;
|
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");
|
FATAL_ERROR_IF(!lua_getinfo(L, "Sl", &ar), "lua_getinfo() failed");
|
||||||
warningstream << " (at " << ar.short_src << ":" << ar.currentline << ")";
|
warningstream << " (at " << ar.short_src << ":" << ar.currentline << ")";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user