]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/content_sao.cpp
Fix on_rightclick() being called directly after placing node
[dragonfireclient.git] / src / content_sao.cpp
index 386b7e070d160fb4d083b452c67b48029d9eff70..0fa806c1a11c483c155bdf5f0dc02fade756e469 100644 (file)
@@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "collision.h"
 #include "environment.h"
 #include "settings.h"
-#include "profiler.h"
 #include "serialization.h" // For compressZlib
 #include "tool.h" // For ToolCapabilities
 #include "gamedef.h"
@@ -394,7 +393,7 @@ std::string LuaEntitySAO::getClientInitializationData(u16 protocol_version)
 
 std::string LuaEntitySAO::getStaticData()
 {
-       verbosestream<<__FUNCTION_NAME<<std::endl;
+       verbosestream<<FUNCTION_NAME<<std::endl;
        std::ostringstream os(std::ios::binary);
        // version
        writeU8(os, 1);
@@ -591,6 +590,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<int> LuaEntitySAO::getAttachmentChildIds()
+{
+       return m_attachment_child_ids;
+}
+
 ObjectProperties* LuaEntitySAO::accessObjectProperties()
 {
        return &m_prop;
@@ -807,8 +821,8 @@ void PlayerSAO::removingFromEnvironment()
        {
                m_player->setPlayerSAO(NULL);
                m_player->peer_id = 0;
-               m_env->savePlayer(m_player->getName());
-               m_env->removePlayer(m_player->getName());
+               m_env->savePlayer((RemotePlayer*)m_player);
+               m_env->removePlayer(m_player);
        }
 }
 
@@ -1231,6 +1245,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<int> PlayerSAO::getAttachmentChildIds()
+{
+       return m_attachment_child_ids;
+}
+
 ObjectProperties* PlayerSAO::accessObjectProperties()
 {
        return &m_prop;