aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2016-12-29 19:35:22 +0100
committersfan5 <sfan5@live.de>2016-12-29 19:35:22 +0100
commitdd3cda6bedf0ed7443258f33d5a5cf68fa120534 (patch)
tree297970db2d2dadef74f1f9bef0f60002b809f756 /src
parentabd68d3466b7f2155cf0f1c4172a254f10c1f02e (diff)
downloadminetest-dd3cda6bedf0ed7443258f33d5a5cf68fa120534.tar.gz
minetest-dd3cda6bedf0ed7443258f33d5a5cf68fa120534.tar.bz2
minetest-dd3cda6bedf0ed7443258f33d5a5cf68fa120534.zip
Fix interact range check (thanks to @lhofhansl)
Diffstat (limited to 'src')
-rw-r--r--src/network/serverpackethandler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp
index f99e104ec..d0f4d948d 100644
--- a/src/network/serverpackethandler.cpp
+++ b/src/network/serverpackethandler.cpp
@@ -1440,7 +1440,8 @@ void Server::handleCommand_Interact(NetworkPacket* pkt)
max_d = max_d_hand;
else if (max_d < 0)
max_d = BS * 4.0;
- if (d > max_d * 1.5) {
+ // cube diagonal: sqrt(3) = 1.73
+ if (d > max_d * 1.73) {
actionstream << "Player " << player->getName()
<< " tried to access " << pointed.dump()
<< " from too far: "