File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -736,7 +736,8 @@ ClientActiveObject* GenericCAO::getParent()
736
736
737
737
void GenericCAO::removeFromScene (bool permanent)
738
738
{
739
- if ((m_env != 0 ) && (permanent)) // Should be true when removing the object permanently and false when refreshing (eg: updating visuals)
739
+ // Should be true when removing the object permanently and false when refreshing (eg: updating visuals)
740
+ if ((m_env != NULL ) && (permanent))
740
741
{
741
742
for (std::vector<u16>::iterator ci = m_children.begin ();
742
743
ci != m_children.end (); ci++)
@@ -747,6 +748,12 @@ void GenericCAO::removeFromScene(bool permanent)
747
748
}
748
749
749
750
m_env->m_attachements [getId ()] = 0 ;
751
+
752
+ LocalPlayer* player = m_env->getLocalPlayer ();
753
+ if (this == player->parent ) {
754
+ player->parent = NULL ;
755
+ player->isAttached = false ;
756
+ }
750
757
}
751
758
752
759
if (m_meshnode)
You can’t perform that action at this time.
0 commit comments