]> git.lizzy.rs Git - minetest.git/commitdiff
mainmenu: Tidy up logic in is_server_protocol_compat() (#3997)
authorSmallJoker <SmallJoker@users.noreply.github.com>
Fri, 15 Apr 2016 12:37:09 +0000 (14:37 +0200)
committerest31 <est31@users.noreply.github.com>
Fri, 15 Apr 2016 12:37:09 +0000 (14:37 +0200)
Apply de morgan to simplify the logic.

builtin/mainmenu/common.lua

index b9a010e61a65b5fa23fd9cfa9854bf929179e95d..3dd7d8b4af8627e788217ded037361b272be1968 100644 (file)
@@ -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)