mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-02 08:51:30 +01:00
#181 fix
This commit is contained in:
parent
921a609830
commit
9daa1abb2f
@ -96,7 +96,6 @@ public class DPlayers {
|
|||||||
*/
|
*/
|
||||||
public void addPlayer(DGlobalPlayer player) {
|
public void addPlayer(DGlobalPlayer player) {
|
||||||
removePlayer(player);
|
removePlayer(player);
|
||||||
|
|
||||||
dGlobalPlayers.add(player);
|
dGlobalPlayers.add(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,13 +104,8 @@ public class DPlayers {
|
|||||||
* an instance of DGlobalPlayer to remove
|
* an instance of DGlobalPlayer to remove
|
||||||
*/
|
*/
|
||||||
public void removePlayer(DGlobalPlayer player) {
|
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) {
|
for (DGlobalPlayer dGlobalPlayer : dGlobalPlayers) {
|
||||||
if (dGlobalPlayer.getName().equals(player.getName())) {
|
if (dGlobalPlayer.getPlayer().equals(player.getPlayer())) {
|
||||||
dGlobalPlayers.remove(dGlobalPlayer);
|
dGlobalPlayers.remove(dGlobalPlayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user