From 6530ed4dd8e8304a6f7769b05bd776535c9c3abc Mon Sep 17 00:00:00 2001 From: TriBlade9 Date: Thu, 14 Apr 2016 02:15:41 -0700 Subject: Add option to disable entity selectionboxes. (#3992) Setting only loaded once, default value is to enable them. --- src/game.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index c1f80c5a1..d513517b7 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -329,6 +329,8 @@ PointedThing getPointedThing(Client *client, Hud *hud, const v3f &player_positio std::vector *selectionboxes = hud->getSelectionBoxes(); selectionboxes->clear(); + static const bool show_entity_selectionbox = g_settings->getBool("show_entity_selectionbox"); + selected_object = NULL; INodeDefManager *nodedef = client->getNodeDefManager(); @@ -342,7 +344,8 @@ PointedThing getPointedThing(Client *client, Hud *hud, const v3f &player_positio camera_position, shootline); if (selected_object != NULL) { - if (selected_object->doShowSelectionBox()) { + if (show_entity_selectionbox && + selected_object->doShowSelectionBox()) { aabb3f *selection_box = selected_object->getSelectionBox(); // Box should exist because object was // returned in the first place -- cgit v1.2.3