mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-09-05 20:38:08 +02:00
#181 fix
This commit is contained in:
parent
921a609830
commit
9daa1abb2f
@ -96,7 +96,6 @@ public class DPlayers {
|
||||
*/
|
||||
public void addPlayer(DGlobalPlayer player) {
|
||||
removePlayer(player);
|
||||
|
||||
dGlobalPlayers.add(player);
|
||||
}
|
||||
|
||||
@ -105,13 +104,8 @@ public class DPlayers {
|
||||
* an instance of DGlobalPlayer to remove
|
||||
*/
|
||||
public void removePlayer(DGlobalPlayer player) {
|
||||
if (dGlobalPlayers.remove(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Fallback check just in case an old Player instance is kept
|
||||
for (DGlobalPlayer dGlobalPlayer : dGlobalPlayers) {
|
||||
if (dGlobalPlayer.getName().equals(player.getName())) {
|
||||
if (dGlobalPlayer.getPlayer().equals(player.getPlayer())) {
|
||||
dGlobalPlayers.remove(dGlobalPlayer);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user