aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-10-18 19:53:34 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-10-18 19:53:34 +0300
commit28f2fdb6dec0c54ce9e32df79a73ef19aee03fd5 (patch)
treef6e7c740a66f1460b577a989c3971ab7854173ae
parent4e1055543c01af8f17f1ab2e742922575170251e (diff)
downloadminetest-28f2fdb6dec0c54ce9e32df79a73ef19aee03fd5.tar.gz
minetest-28f2fdb6dec0c54ce9e32df79a73ef19aee03fd5.tar.bz2
minetest-28f2fdb6dec0c54ce9e32df79a73ef19aee03fd5.zip
Fix possible NULL dereference in MobV2CAO::step
-rw-r--r--src/content_cao.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index 67594eb9f..6cb2cee38 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -1000,6 +1000,8 @@ void MobV2CAO::step(float dtime, ClientEnvironment *env)
if(m_sprite_type == "humanoid_1"){
scene::ICameraSceneNode* camera = m_node->getSceneManager()->getActiveCamera();
+ if(!camera)
+ return;
v3f cam_to_mob = m_node->getAbsolutePosition() - camera->getAbsolutePosition();
cam_to_mob.normalize();
int col = 0;