diff options
author | rubenwardy <rw@rubenwardy.com> | 2019-08-06 19:30:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-06 19:30:18 +0100 |
commit | 8e757859d6a6bf6482480904e8485e9344e567ab (patch) | |
tree | 3304aa9393a753b85143389c6f6ffec990cfa12e /builtin/mainmenu/common.lua | |
parent | 8da35c22d1c8933090330b2f3c44b4cf2c6e6760 (diff) | |
download | minetest-8e757859d6a6bf6482480904e8485e9344e567ab.tar.xz |
Add luacheck to check builtin (#7895)
Diffstat (limited to 'builtin/mainmenu/common.lua')
-rw-r--r-- | builtin/mainmenu/common.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua index cc61fe0ad..782d6973f 100644 --- a/builtin/mainmenu/common.lua +++ b/builtin/mainmenu/common.lua @@ -93,9 +93,9 @@ function render_serverlist_row(spec, is_favorite) end end - local details = "" local grey_out = not is_server_protocol_compat(spec.proto_min, spec.proto_max) + local details if is_favorite then details = "1," else @@ -118,11 +118,11 @@ function render_serverlist_row(spec, is_favorite) end if spec.clients and spec.clients_max then - local clients_color = '' local clients_percent = 100 * spec.clients / spec.clients_max -- Choose a color depending on how many clients are connected -- (relatively to clients_max) + local clients_color if grey_out then clients_color = '#aaaaaa' elseif spec.clients == 0 then clients_color = '' -- 0 players: default/white elseif clients_percent <= 60 then clients_color = '#a1e587' -- 0-60%: green @@ -171,6 +171,7 @@ os.tempfolder = function() local filetocheck = os.tmpname() os.remove(filetocheck) + -- luacheck: ignore -- https://blogs.msdn.microsoft.com/vcblog/2014/06/18/c-runtime-crt-features-fixes-and-breaking-changes-in-visual-studio-14-ctp1/ -- The C runtime (CRT) function called by os.tmpname is tmpnam. -- Microsofts tmpnam implementation in older CRT / MSVC releases is defective. |