From e08052d7d670d27c7bcc3f97279806081dfadd1a Mon Sep 17 00:00:00 2001 From: TranquillyUnpleasant <62061444+TranquillyUnpleasant@users.noreply.github.com> Date: Fri, 12 Mar 2021 02:54:10 +0500 Subject: [PATCH] Votekick edit (#4924) * Add "yes" and "no" compatibility to votekicks * Lowercase --- core/src/mindustry/core/NetServer.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 92509ec2e8..370b7697bf 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -464,12 +464,18 @@ public class NetServer implements ApplicationListener{ return; } - if(!arg[0].equalsIgnoreCase("y") && !arg[0].equalsIgnoreCase("n")){ + int sign; + switch(arg[0].toLowerCase()){ + case "y", "yes" -> sign = 1; + case "n", "no" -> sign = -1; + default -> sign = 0; + } + + if(sign == 0){ player.sendMessage("[scarlet]Vote either 'y' (yes) or 'n' (no)."); return; } - int sign = arg[0].equalsIgnoreCase("y") ? 1 : -1; currentlyKicking[0].vote(player, sign); } });