Prevent client crashing if an NDT_AIRLIKE node is dropped
The player dropping the node can either be themselves or another player (i.e. without this fix you can crash other people's clients) Thanks CWz for reporting the issue
This commit is contained in:
parent
2d849b0a19
commit
beb6b3e593
|
@ -411,8 +411,7 @@ void WieldMeshSceneNode::changeToMesh(scene::IMesh *mesh)
|
||||||
m_meshnode->setVisible(false);
|
m_meshnode->setVisible(false);
|
||||||
m_meshnode->setMesh(dummymesh);
|
m_meshnode->setMesh(dummymesh);
|
||||||
dummymesh->drop(); // m_meshnode grabbed it
|
dummymesh->drop(); // m_meshnode grabbed it
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if (m_lighting) {
|
if (m_lighting) {
|
||||||
m_meshnode->setMesh(mesh);
|
m_meshnode->setMesh(mesh);
|
||||||
} else {
|
} else {
|
||||||
|
@ -426,6 +425,7 @@ void WieldMeshSceneNode::changeToMesh(scene::IMesh *mesh)
|
||||||
m_meshnode->setMesh(new_mesh);
|
m_meshnode->setMesh(new_mesh);
|
||||||
new_mesh->drop(); // m_meshnode grabbed it
|
new_mesh->drop(); // m_meshnode grabbed it
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_meshnode->setMaterialFlag(video::EMF_LIGHTING, m_lighting);
|
m_meshnode->setMaterialFlag(video::EMF_LIGHTING, m_lighting);
|
||||||
// need to normalize normals when lighting is enabled (because of setScale())
|
// need to normalize normals when lighting is enabled (because of setScale())
|
||||||
|
|
Loading…
Reference in New Issue