summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2016-04-15 14:37:09 +0200
committerest31 <est31@users.noreply.github.com>2016-04-15 14:37:09 +0200
commitd82c5da0dccb1f30250725d17c3f373aacdda0e2 (patch)
tree4f90f0f47d4d7554727661782a9b2c359f865747
parent6530ed4dd8e8304a6f7769b05bd776535c9c3abc (diff)
downloadminetest-d82c5da0dccb1f30250725d17c3f373aacdda0e2.tar.gz
minetest-d82c5da0dccb1f30250725d17c3f373aacdda0e2.tar.bz2
minetest-d82c5da0dccb1f30250725d17c3f373aacdda0e2.zip
mainmenu: Tidy up logic in is_server_protocol_compat() (#3997)
Apply de morgan to simplify the logic.
-rw-r--r--builtin/mainmenu/common.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua
index b9a010e61..3dd7d8b4a 100644
--- a/builtin/mainmenu/common.lua
+++ b/builtin/mainmenu/common.lua
@@ -290,7 +290,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)