Fix #1437 Drone in the analyzer

This commit is contained in:
Nedelosk committed 2016-10-10 10:06:53 +02:00
1 parent e0694842b6
commit 61aa8bdcf0
2 files changed
+11 -3

No files matched your search

@@ -26,7 +26,11 @@ public abstract class Individual implements IIndividual {
}
protected Individual(@Nonnull NBTTagCompound nbt) {
isAnalyzed = nbt.getBoolean("IsAnalyzed");
if(nbt.hasKey("IsAnalyzed")){
isAnalyzed = nbt.getBoolean("IsAnalyzed");
}else{
isAnalyzed = false;
}
}
@Override
@@ -32,8 +32,12 @@ public abstract class IndividualLiving extends Individual implements IIndividual
protected IndividualLiving(@Nonnull NBTTagCompound nbt) {
super(nbt);
health = nbt.getInteger("Health");
maxHealth = nbt.getInteger("MaxH");
if(nbt.hasKey("Health")){
health = nbt.getInteger("Health");
}
if(nbt.hasKey("MaxH")){
maxHealth = nbt.getInteger("MaxH");
}
}
@Override