diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua index e7e90f30..af61bc95 100644 --- a/builtin/mainmenu/common.lua +++ b/builtin/mainmenu/common.lua @@ -289,7 +289,7 @@ end -------------------------------------------------------------------------------- function is_server_protocol_compat(server_proto_min, server_proto_max) - return not ((min_supp_proto > (server_proto_max or 24)) or (max_supp_proto < (server_proto_min or 13))) + return min_supp_proto <= (server_proto_max or 24) and max_supp_proto >= (server_proto_min or 13) end -------------------------------------------------------------------------------- function is_server_protocol_compat_or_error(server_proto_min, server_proto_max) diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index 6dd6ef3f..065d1219 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -241,6 +241,9 @@ send_pre_v25_init (Support older servers) bool true # Save the map received by the client on disk. enable_local_map_saving (Saving map received from server) bool false +# Show entity selection boxes +show_entity_selectionbox (Show entity selection boxes) bool true + # Enable usage of remote media server (if provided by server). # Remote servers offer a significantly faster way to download media (e.g. textures) # when connecting to the server. diff --git a/multicraft.conf.example b/multicraft.conf.example index d53e2296..81a446ca 100644 --- a/multicraft.conf.example +++ b/multicraft.conf.example @@ -253,6 +253,10 @@ # type: bool # enable_local_map_saving = false +# Show entity selection boxes. +# type: bool +# show_entity_selectionbox true + # Enable usage of remote media server (if provided by server). # Remote servers offer a significantly faster way to download media (e.g. textures) # when connecting to the server. diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 487404ed..580a9f47 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -151,6 +151,7 @@ void set_default_settings(Settings *settings) settings->setDefault("desynchronize_mapblock_texture_animation", "true"); settings->setDefault("hud_hotbar_max_width", "1.0"); settings->setDefault("enable_local_map_saving", "false"); + settings->setDefault("show_entity_selectionbox", "true"); settings->setDefault("mip_map", "false"); settings->setDefault("anisotropic_filter", "false"); diff --git a/src/game.cpp b/src/game.cpp index 9a9ab2c5..90725008 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 diff --git a/src/settings_translation_file.cpp b/src/settings_translation_file.cpp index 77fd6c68..beb56d9f 100644 --- a/src/settings_translation_file.cpp +++ b/src/settings_translation_file.cpp @@ -102,6 +102,7 @@ fake_function() { gettext("Whether to support older servers before protocol version 25.\nEnable if you want to connect to 0.4.12 servers and before.\nServers starting with 0.4.13 will work, 0.4.12-dev servers may work.\nDisabling this option will protect your password better."); gettext("Saving map received from server"); gettext("Save the map received by the client on disk."); + gettext("Show entity selection boxes"); gettext("Connect to external media server"); gettext("Enable usage of remote media server (if provided by server).\nRemote servers offer a significantly faster way to download media (e.g. textures)\nwhen connecting to the server."); gettext("Serverlist URL");