diff --git a/buildnumber.properties b/buildnumber.properties index 58563d77..dd261e2a 100644 --- a/buildnumber.properties +++ b/buildnumber.properties @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun Dec 01 17:31:33 CET 2013 -build.number=648 +#Sun Dec 01 18:16:33 CET 2013 +build.number=650 diff --git a/src/me/StevenLawson/TotalFreedomMod/TFM_ServerInterface.java b/src/me/StevenLawson/TotalFreedomMod/TFM_ServerInterface.java index 91e92041..83c783d5 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TFM_ServerInterface.java +++ b/src/me/StevenLawson/TotalFreedomMod/TFM_ServerInterface.java @@ -326,23 +326,25 @@ public class TFM_ServerInterface } } - if (server.getOnlinePlayers().length >= server.getMaxPlayers()) + int count = server.getOnlinePlayers().length; + if (count >= server.getMaxPlayers()) { for (Player p : server.getOnlinePlayers()) { if (!TFM_SuperadminList.isUserSuperadmin(player)) { p.kickPlayer("You have been kicked to free up room for an admin."); + count--; } - if (server.getOnlinePlayers().length < server.getMaxPlayers()) + if (count < server.getMaxPlayers()) { break; } } } - if (server.getOnlinePlayers().length >= server.getMaxPlayers()) + if (count >= server.getMaxPlayers()) { event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "The server is full and a player could not be kicked, sorry!"); return;