summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorDániel Juhász <juhdanad@gmail.com>2017-08-24 06:31:33 +0000
committerSmallJoker <mk939@ymail.com>2018-06-03 17:31:59 +0200
commit2c450ed93f0217d4950bcd4d2be3d5d1b92d7a2d (patch)
tree84280f8b42af774bd588c5baac44e9e6b4ab8ab8 /src/game.cpp
parentd9c7af109ada1e45074d4615b50b8aab2886c2e3 (diff)
downloadminetest-2c450ed93f0217d4950bcd4d2be3d5d1b92d7a2d.tar.gz
minetest-2c450ed93f0217d4950bcd4d2be3d5d1b92d7a2d.tar.bz2
minetest-2c450ed93f0217d4950bcd4d2be3d5d1b92d7a2d.zip
Fix Android node selection distance (#6187)
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 68acc81b7..facc68aea 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -3550,6 +3550,9 @@ void Game::processPlayerInteraction(f32 dtime, bool show_hud, bool show_debug)
if ((g_settings->getBool("touchtarget")) && (g_touchscreengui)) {
shootline = g_touchscreengui->getShootline();
+ // Scale shootline to the acual distance the player can reach
+ shootline.end = shootline.start
+ + shootline.getVector().normalize() * BS * d;
shootline.start += intToFloat(camera_offset, BS);
shootline.end += intToFloat(camera_offset, BS);
}