From 545796e297b5eb7c68e5eefb90e1c5810eb622bc Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 12 Feb 2024 19:21:41 -0600 Subject: [PATCH] players removed when leaving mines --- src/engine/objects/Mine.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 9437fed1..b1206f41 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -632,29 +632,20 @@ public class Mine extends AbstractGameObject { this.dividedPlayers = new HashMap<>(); for(Integer playerID : this._playerMemory){ player = PlayerCharacter.getFromCache(playerID); - Guild guild = player.getGuild(); - Guild nation = guild.getNation(); - Guild entry; - if(nation.equals(Guild.getErrantGuild())){ - entry = nation; - }else if(guild.equals(Guild.getErrantGuild())){ - entry = guild; - } else{ - entry = Guild.getErrantGuild(); - } - if(this.dividedPlayers.containsKey(entry)){ - this.dividedPlayers.get(entry).add(playerID); + Guild nation = player.getGuild().getNation(); Guild entry; + if(this.dividedPlayers.containsKey(nation)){ + this.dividedPlayers.get(nation).add(playerID); }else{ ArrayList newEntry = new ArrayList<>(); newEntry.add(playerID); - this.dividedPlayers.put(entry,newEntry); + this.dividedPlayers.put(nation,newEntry); } } if(updated == true){ for(Integer playerID : this._playerMemory){ player = PlayerCharacter.getFromCache(playerID); for(Guild present : this.dividedPlayers.keySet()) { - ChatManager.chatSystemInfo(player,present.getName() + "COUNT: " + this.dividedPlayers.get(present).size() + " (" + (this.dividedPlayers.get(present).size()/this.totalPlayers * 100) + "%)"); + ChatManager.chatSystemInfo(player,present.getName() + "COUNT: " + this.dividedPlayers.get(present).size()); } } }