mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-24 21:41:25 -08:00
Fixed a crash which could occur when unconstructing environment (#290)
This commit is contained in:
parent
6caad0daf6
commit
8716695d4e
1 changed files with 8 additions and 6 deletions
|
|
@ -79,12 +79,14 @@ public class Drone extends FlyingUnit implements BuilderTrait{
|
|||
}
|
||||
|
||||
//if it's missing requirements, try and mine them
|
||||
for(ItemStack stack : entity.recipe.requirements){
|
||||
if(!core.items.has(stack.item, stack.amount) && type.toMine.contains(stack.item)){
|
||||
targetItem = stack.item;
|
||||
getPlaceQueue().clear();
|
||||
setState(mine);
|
||||
return;
|
||||
if(entity.recipe != null){
|
||||
for(ItemStack stack : entity.recipe.requirements){
|
||||
if(!core.items.has(stack.item, stack.amount) && type.toMine.contains(stack.item)){
|
||||
targetItem = stack.item;
|
||||
getPlaceQueue().clear();
|
||||
setState(mine);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue