diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index b9619b4b..e043cc84 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -4839,19 +4839,23 @@ public class PlayerCharacter extends AbstractCharacter { } public static boolean checkIfBoxed(PlayerCharacter player){ - for(PlayerCharacter pc : SessionManager.getAllActivePlayers()){ - if(!pc.isActive) - continue; - if(!pc.enteredWorld) - continue; - if(pc.equals(player)) - continue; - if(pc.getClientConnection().machineID.equals(player.getClientConnection().machineID)) - if(pc.isBoxed == false) - return true; + try { + for (PlayerCharacter pc : SessionManager.getAllActivePlayers()) { + if (!pc.isActive) + continue; + if (!pc.enteredWorld) + continue; + if (pc.equals(player)) + continue; + if (pc.getClientConnection().machineID.equals(player.getClientConnection().machineID)) + if (pc.isBoxed == false) + return true; + } + return false; + }catch(Exception e){ + return false; } - return false; } @Override