ContentCAO: Fix broken attachments on join (#8701)
authorSmallJoker <SmallJoker@users.noreply.github.com>
Mon, 29 Jul 2019 17:14:07 +0000 (19:14 +0200)
committerGitHub <noreply@github.com>
Mon, 29 Jul 2019 17:14:07 +0000 (19:14 +0200)
commit4aa9a669cb184b77213e8df82eb20eda5aad9004
treead252a18613aa7ecfdfee57074585a43c59f2881
parent50052fced51c6a97414472a84aac8ec9bb57d3ee
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
src/activeobject.h
src/client/clientenvironment.cpp
src/client/clientenvironment.h
src/client/clientobject.h
src/client/content_cao.cpp
src/client/content_cao.h
src/content_sao.cpp
src/content_sao.h
src/serverobject.h