mirror of
https://github.com/minetest/minetest.git
synced 2024-12-02 20:43:45 +01:00
Fix possible NULL dereference in MobV2CAO::step
This commit is contained in:
parent
4e1055543c
commit
28f2fdb6de
@ -1000,6 +1000,8 @@ void MobV2CAO::step(float dtime, ClientEnvironment *env)
|
|||||||
|
|
||||||
if(m_sprite_type == "humanoid_1"){
|
if(m_sprite_type == "humanoid_1"){
|
||||||
scene::ICameraSceneNode* camera = m_node->getSceneManager()->getActiveCamera();
|
scene::ICameraSceneNode* camera = m_node->getSceneManager()->getActiveCamera();
|
||||||
|
if(!camera)
|
||||||
|
return;
|
||||||
v3f cam_to_mob = m_node->getAbsolutePosition() - camera->getAbsolutePosition();
|
v3f cam_to_mob = m_node->getAbsolutePosition() - camera->getAbsolutePosition();
|
||||||
cam_to_mob.normalize();
|
cam_to_mob.normalize();
|
||||||
int col = 0;
|
int col = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user