mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Rework object attachment handling to fix bugs (#14825)
This commit is contained in:
parent
a0e33ba9ea
commit
85e717fcd1
17 changed files with 245 additions and 172 deletions
|
@ -147,7 +147,7 @@ void LuaEntitySAO::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 << "LuaEntitySAO::step() " << m_init_name << " at " << m_last_sent_position << ", id=" << m_id <<
|
||||
" is attached to nonexistent parent. This is a bug." << std::endl;
|
||||
|
@ -415,8 +415,6 @@ void LuaEntitySAO::setHP(s32 hp, const PlayerHPChangeReason &reason)
|
|||
sendPunchCommand();
|
||||
|
||||
if (m_hp == 0 && !isGone()) {
|
||||
clearParentAttachment();
|
||||
clearChildAttachments();
|
||||
if (m_registered) {
|
||||
ServerActiveObject *killer = nullptr;
|
||||
if (reason.type == PlayerHPChangeReason::PLAYER_PUNCH)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue