ParticleSpawner: Fix crash when attaching to invisible entity
[oweals/minetest.git] / src / client / content_cao.h
index 699148c52306416eaaa4ea318db4e04678afb888..974ff9a1eecfd376f52d80639224024dec0468ae 100644 (file)
@@ -188,10 +188,11 @@ public:
                return m_matrixnode->getRelativeTransformationMatrix();
        }
 
-       inline const core::matrix4 &getAbsolutePosRotMatrix() const
+       inline const core::matrix4 *getAbsolutePosRotMatrix() const
        {
-               assert(m_matrixnode);
-               return m_matrixnode->getAbsoluteTransformation();
+               if (!m_matrixnode)
+                       return nullptr;
+               return &m_matrixnode->getAbsoluteTransformation();
        }
 
        inline f32 getStepHeight() const