forked from Mirrorlandia_minetest/minetest
ParticleSpawner: Fix crash when attaching to invisible entity
This commit is contained in:
parent
495f7198ef
commit
57df895cf9
@ -188,10 +188,11 @@ public:
|
|||||||
return m_matrixnode->getRelativeTransformationMatrix();
|
return m_matrixnode->getRelativeTransformationMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const core::matrix4 &getAbsolutePosRotMatrix() const
|
inline const core::matrix4 *getAbsolutePosRotMatrix() const
|
||||||
{
|
{
|
||||||
assert(m_matrixnode);
|
if (!m_matrixnode)
|
||||||
return m_matrixnode->getAbsoluteTransformation();
|
return nullptr;
|
||||||
|
return &m_matrixnode->getAbsoluteTransformation();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline f32 getStepHeight() const
|
inline f32 getStepHeight() const
|
||||||
|
@ -349,7 +349,7 @@ void ParticleSpawner::step(float dtime, ClientEnvironment *env)
|
|||||||
const core::matrix4 *attached_absolute_pos_rot_matrix = nullptr;
|
const core::matrix4 *attached_absolute_pos_rot_matrix = nullptr;
|
||||||
if (m_attached_id) {
|
if (m_attached_id) {
|
||||||
if (GenericCAO *attached = dynamic_cast<GenericCAO *>(env->getActiveObject(m_attached_id))) {
|
if (GenericCAO *attached = dynamic_cast<GenericCAO *>(env->getActiveObject(m_attached_id))) {
|
||||||
attached_absolute_pos_rot_matrix = &attached->getAbsolutePosRotMatrix();
|
attached_absolute_pos_rot_matrix = attached->getAbsolutePosRotMatrix();
|
||||||
} else {
|
} else {
|
||||||
unloaded = true;
|
unloaded = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user