Browse Source

players removed when leaving mines

lakebane-master
FatBoy-DOTC 11 months ago
parent
commit
545796e297
  1. 19
      src/engine/objects/Mine.java

19
src/engine/objects/Mine.java

@ -632,29 +632,20 @@ public class Mine extends AbstractGameObject {
this.dividedPlayers = new HashMap<>(); this.dividedPlayers = new HashMap<>();
for(Integer playerID : this._playerMemory){ for(Integer playerID : this._playerMemory){
player = PlayerCharacter.getFromCache(playerID); player = PlayerCharacter.getFromCache(playerID);
Guild guild = player.getGuild(); Guild nation = player.getGuild().getNation(); Guild entry;
Guild nation = guild.getNation(); if(this.dividedPlayers.containsKey(nation)){
Guild entry; this.dividedPlayers.get(nation).add(playerID);
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);
}else{ }else{
ArrayList<Integer> newEntry = new ArrayList<>(); ArrayList<Integer> newEntry = new ArrayList<>();
newEntry.add(playerID); newEntry.add(playerID);
this.dividedPlayers.put(entry,newEntry); this.dividedPlayers.put(nation,newEntry);
} }
} }
if(updated == true){ if(updated == true){
for(Integer playerID : this._playerMemory){ for(Integer playerID : this._playerMemory){
player = PlayerCharacter.getFromCache(playerID); player = PlayerCharacter.getFromCache(playerID);
for(Guild present : this.dividedPlayers.keySet()) { 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());
} }
} }
} }

Loading…
Cancel
Save