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
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-08-24 08:31:33 +0200
commit01c319d7784c3db614a53745e5af62c43cf45c90 (patch)
tree3896b4798fdfd5a5ac2408be73ad211f29e66df4 /src/game.cpp
parent397a701f985f918cf8403802575045435de40c9a (diff)
downloadminetest-01c319d7784c3db614a53745e5af62c43cf45c90.tar.gz
minetest-01c319d7784c3db614a53745e5af62c43cf45c90.tar.bz2
minetest-01c319d7784c3db614a53745e5af62c43cf45c90.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 c3d844634..68b8e0767 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -3544,6 +3544,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);
}