summaryrefslogtreecommitdiff
path: root/src/client/clientobject.h
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-07-29 19:14:07 +0200
committerGitHub <noreply@github.com>2019-07-29 19:14:07 +0200
commit4aa9a669cb184b77213e8df82eb20eda5aad9004 (patch)
treead252a18613aa7ecfdfee57074585a43c59f2881 /src/client/clientobject.h
parent50052fced51c6a97414472a84aac8ec9bb57d3ee (diff)
downloadminetest-4aa9a669cb184b77213e8df82eb20eda5aad9004.tar.gz
minetest-4aa9a669cb184b77213e8df82eb20eda5aad9004.tar.bz2
minetest-4aa9a669cb184b77213e8df82eb20eda5aad9004.zip
ContentCAO: Fix broken attachments on join (#8701)
What happened: 1) Object data is received. Client begins to read the data 2) Client initializes all its children (gob_cmd_update_infant) 3) Children try to attach to parent (yet not added) 4) Parent initializes, is added to the environment And somewhere in between, Irrlicht wrecks up the attachments due to the missing matrix node. The solution here is to: 1) Use the same structure as ServerActiveObject 2) Attach all children after the parent is really initialized
Diffstat (limited to 'src/client/clientobject.h')
-rw-r--r--src/client/clientobject.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/clientobject.h b/src/client/clientobject.h
index 5e34177e4..987005730 100644
--- a/src/client/clientobject.h
+++ b/src/client/clientobject.h
@@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irrlichttypes_extrabloated.h"
#include "activeobject.h"
#include <unordered_map>
+#include <unordered_set>
+
class ClientEnvironment;
class ITextureSource;
@@ -51,8 +53,12 @@ public:
virtual scene::ISceneNode *getSceneNode() { return NULL; }
virtual scene::IAnimatedMeshSceneNode *getAnimatedMeshSceneNode() { return NULL; }
virtual bool isLocalPlayer() const {return false;}
+
virtual ClientActiveObject *getParent() const { return nullptr; };
- virtual void setAttachments() {}
+ virtual const std::unordered_set<int> &getAttachmentChildIds() const
+ { static std::unordered_set<int> rv; return rv; }
+ virtual void updateAttachments() {};
+
virtual bool doShowSelectionBox(){return true;}
// Step object in time