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