aboutsummaryrefslogtreecommitdiff
path: root/src/content_cao.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r--src/content_cao.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index a05936d2c..fe11d33da 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -670,6 +670,7 @@ GenericCAO::~GenericCAO()
{
m_env->removePlayerName(m_name.c_str());
}
+ removeFromScene(true);
}
core::aabbox3d<f32>* GenericCAO::getSelectionBox()
@@ -735,7 +736,7 @@ ClientActiveObject* GenericCAO::getParent()
void GenericCAO::removeFromScene(bool permanent)
{
- if(permanent) // Should be true when removing the object permanently and false when refreshing (eg: updating visuals)
+ if((m_env != 0) && (permanent)) // Should be true when removing the object permanently and false when refreshing (eg: updating visuals)
{
for(std::vector<u16>::iterator ci = m_children.begin();
ci != m_children.end(); ci++)