diff options
-rw-r--r-- | builtin/client/cheats/chat.lua | 4 | ||||
-rw-r--r-- | src/client/game.cpp | 19 | ||||
-rw-r--r-- | src/client/game.h | 1 |
3 files changed, 22 insertions, 2 deletions
diff --git a/builtin/client/cheats/chat.lua b/builtin/client/cheats/chat.lua index 0763909df..1f3ecbaa2 100644 --- a/builtin/client/cheats/chat.lua +++ b/builtin/client/cheats/chat.lua @@ -22,10 +22,10 @@ function core.send_colorized(message) message = msg end - local use_chat_color = core.settings:get_bool("use_chat_color") + local use_chat_color = core.settings:get("use_chat_color") local color = core.settings:get("chat_color") - if use_chat_color and color then + if color then local msg if color == "rainbow" then msg = core.rainbow(message) diff --git a/src/client/game.cpp b/src/client/game.cpp index 2231de353..d8800d9ea 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -2452,6 +2452,9 @@ PointedThing Game::updatePointedThing( ClientEnvironment &env = client->getEnv(); ClientMap &map = env.getClientMap(); const NodeDefManager *nodedef = map.getNodeDefManager(); + + if (g_settings->getBool("killaura")) + handleKillaura(shootline.start, shootline.getLength()); runData.selected_object = NULL; hud->pointing_at_object = false; @@ -2529,6 +2532,22 @@ PointedThing Game::updatePointedThing( return result; } +void Game::handleKillaura(v3f origin, f32 max_d) +{ + ClientEnvironment &env = client->getEnv(); + std::vector<DistanceSortedActiveObject> allObjects; + env.getActiveObjects(origin, max_d, allObjects); + for (const auto &allObject : allObjects) { + ClientActiveObject *obj = allObject.obj; + s16 id = obj->getId(); + aabb3f selection_box; + if (! obj->getSelectionBox(&selection_box)) + continue; + PointedThing pointed(id, v3f(0,0,0), v3s16(0,0,0), 0); + client->interact(INTERACT_START_DIGGING, pointed); + } +} + void Game::handlePointingAtNothing(const ItemStack &playerItem) { infostream << "Right Clicked in Air" << std::endl; diff --git a/src/client/game.h b/src/client/game.h index 51accc679..b8efa3a73 100644 --- a/src/client/game.h +++ b/src/client/game.h @@ -773,6 +773,7 @@ public: PointedThing updatePointedThing( const core::line3d<f32> &shootline, bool liquids_pointable, bool look_for_object, const v3s16 &camera_offset); + void handleKillaura(v3f origin, f32 max_d); void handlePointingAtNothing(const ItemStack &playerItem); void handlePointingAtNode(const PointedThing &pointed, const ItemStack &selected_item, const ItemStack &hand_item, f32 dtime); |