Fixed NPEs

This commit is contained in:
Frank Baumann 2012-11-06 23:13:44 +01:00
parent 0e940816e0
commit 0b05a63fc1

View File

@ -74,6 +74,7 @@ public class DPlayer {
this.player.getInventory().clear();
this.player.getInventory().setArmorContents(null);
this.player.setTotalExperience(0);
this.player.setLevel(0);
this.player.setHealth(20);
this.player.setFoodLevel(20);
this.isEditing=isEditing;
@ -159,6 +160,7 @@ public class DPlayer {
}
//Give Secure Objects other Players
if(dgroup!=null){
if(!dgroup.isEmpty()){
int i=0;
Player groupplayer;
@ -179,6 +181,7 @@ public class DPlayer {
}
}
}
@ -234,10 +237,9 @@ public class DPlayer {
DungeonsXL.p.msg(this.player, ChatColor.YELLOW+"Du hast den Dungeon erfolgreich beendet!");
this.isFinished=true;
DGroup dgroup=DGroup.get(this.player);
if(dgroup.isPlaying){
if(dgroup!=null){
if(dgroup.isPlaying){
for(Player player:dgroup.players){
DPlayer dplayer=get(player);
if(!dplayer.isFinished){
@ -246,17 +248,12 @@ public class DPlayer {
}
}
for(Player player:dgroup.players){
DPlayer dplayer=get(player);
dplayer.leave();
}
}
}
}
public void msg(String msg){
@ -379,6 +376,7 @@ public class DPlayer {
public void addTreasure(){
new DLootInventory(this.player,this.treasureInv.getContents());
}
//Static
public static void remove(DPlayer player){
players.remove(player);