Fixed a crash which could occur when unconstructing environment (#290)

This commit is contained in:
Timmeey86
2018-11-01 02:13:51 +01:00
committed by Anuken
parent 6caad0daf6
commit 8716695d4e

View File

@@ -79,12 +79,14 @@ public class Drone extends FlyingUnit implements BuilderTrait{
} }
//if it's missing requirements, try and mine them //if it's missing requirements, try and mine them
for(ItemStack stack : entity.recipe.requirements){ if(entity.recipe != null){
if(!core.items.has(stack.item, stack.amount) && type.toMine.contains(stack.item)){ for(ItemStack stack : entity.recipe.requirements){
targetItem = stack.item; if(!core.items.has(stack.item, stack.amount) && type.toMine.contains(stack.item)){
getPlaceQueue().clear(); targetItem = stack.item;
setState(mine); getPlaceQueue().clear();
return; setState(mine);
return;
}
} }
} }