diff options
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r-- | src/content_cao.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp index aff143bf2..49c2049eb 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -283,8 +283,14 @@ public: void initialize(const std::string &data); - aabb3f *getSelectionBox() - {return &m_selection_box;} + + virtual bool getSelectionBox(aabb3f *toset) const + { + *toset = m_selection_box; + return true; + } + + v3f getPosition() {return m_position;} inline float getYaw() const @@ -605,11 +611,14 @@ GenericCAO::~GenericCAO() removeFromScene(true); } -aabb3f *GenericCAO::getSelectionBox() +bool GenericCAO::getSelectionBox(aabb3f *toset) const { - if(!m_prop.is_visible || !m_is_visible || m_is_local_player || getParent() != NULL) - return NULL; - return &m_selection_box; + if (!m_prop.is_visible || !m_is_visible || m_is_local_player + || getParent() != NULL){ + return false; + } + *toset = m_selection_box; + return true; } v3f GenericCAO::getPosition() @@ -658,7 +667,7 @@ void GenericCAO::setAttachments() updateAttachments(); } -ClientActiveObject* GenericCAO::getParent() +ClientActiveObject* GenericCAO::getParent() const { ClientActiveObject *obj = NULL; |