Bugfix: dont highlight (0,0,0) when theres no node pointed.
authorRealBadAngel <maciej.kasatkin@o2.pl>
Fri, 3 Oct 2014 14:03:14 +0000 (16:03 +0200)
committerRealBadAngel <maciej.kasatkin@o2.pl>
Fri, 3 Oct 2014 14:03:14 +0000 (16:03 +0200)
src/game.cpp

index a8f6bc992bf417ff6796d7ceba061f9f1448e40c..12bc695a61fc69e6cb76ac93d8355d9c23b0f7b8 100644 (file)
@@ -2786,8 +2786,13 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
                if(pointed != pointed_old)
                {
                        infostream<<"Pointing at "<<pointed.dump()<<std::endl;
-                       if (g_settings->getBool("enable_node_highlighting"))
-                               client.setHighlighted(pointed.node_undersurface, show_hud);
+                       if (g_settings->getBool("enable_node_highlighting")) {
+                               if (pointed.type == POINTEDTHING_NODE) {
+                                       client.setHighlighted(pointed.node_undersurface, show_hud);
+                               } else {
+                                       client.setHighlighted(pointed.node_undersurface, false);
+                               }
+                       }
                }
 
                /*