mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-22 04:15:44 +02:00
Rework object attachment handling to fix bugs (#14825)
This commit is contained in:
@@ -233,13 +233,12 @@ void PlayerSAO::step(float dtime, bool send_recommended)
|
||||
}
|
||||
|
||||
// If attached, check that our parent is still there. If it isn't, detach.
|
||||
if (m_attachment_parent_id && !isAttached()) {
|
||||
if (m_attachment_parent_id && !getParent()) {
|
||||
// This is handled when objects are removed from the map
|
||||
warningstream << "PlayerSAO::step() id=" << m_id <<
|
||||
" is attached to nonexistent parent. This is a bug." << std::endl;
|
||||
clearParentAttachment();
|
||||
setBasePosition(m_last_good_position);
|
||||
m_env->getGameDef()->SendMovePlayer(this);
|
||||
setPos(m_last_good_position);
|
||||
}
|
||||
|
||||
//dstream<<"PlayerSAO::step: dtime: "<<dtime<<std::endl;
|
||||
|
||||
Reference in New Issue
Block a user