From 8d03301138c0e82728d61b957ea47a5a4061633a Mon Sep 17 00:00:00 2001 From: TeTpaAka Date: Fri, 3 Jul 2015 12:31:34 +0200 Subject: Fix invisible player when the attached entity is removed --- src/content_sao.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/content_sao.cpp') diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 386b7e070..eab1e6279 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -591,6 +591,21 @@ void LuaEntitySAO::getAttachment(int *parent_id, std::string *bone, v3f *positio *rotation = m_attachment_rotation; } +void LuaEntitySAO::addAttachmentChild(int child_id) +{ + m_attachment_child_ids.insert(child_id); +} + +void LuaEntitySAO::removeAttachmentChild(int child_id) +{ + m_attachment_child_ids.erase(child_id); +} + +std::set LuaEntitySAO::getAttachmentChildIds() +{ + return m_attachment_child_ids; +} + ObjectProperties* LuaEntitySAO::accessObjectProperties() { return &m_prop; @@ -1231,6 +1246,21 @@ void PlayerSAO::getAttachment(int *parent_id, std::string *bone, v3f *position, *rotation = m_attachment_rotation; } +void PlayerSAO::addAttachmentChild(int child_id) +{ + m_attachment_child_ids.insert(child_id); +} + +void PlayerSAO::removeAttachmentChild(int child_id) +{ + m_attachment_child_ids.erase(child_id); +} + +std::set PlayerSAO::getAttachmentChildIds() +{ + return m_attachment_child_ids; +} + ObjectProperties* PlayerSAO::accessObjectProperties() { return &m_prop; -- cgit v1.2.3