mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-03-09 08:20:55 -07:00
Fixed vaults not counting withdrawn items
This commit is contained in:
parent
47e622dee3
commit
2a6b0fd0ce
1 changed files with 13 additions and 0 deletions
|
|
@ -10,6 +10,8 @@ import mindustry.world.*;
|
|||
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class StorageBlock extends Block{
|
||||
|
||||
public StorageBlock(String name){
|
||||
|
|
@ -64,6 +66,17 @@ public class StorageBlock extends Block{
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int removeStack(Item item, int amount){
|
||||
int result = super.removeStack(item, amount);
|
||||
|
||||
if(linkedCore != null && team == state.rules.defaultTeam && state.isCampaign()){
|
||||
state.rules.sector.info.handleCoreItem(item, -result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaximumAccepted(Item item){
|
||||
return itemCapacity;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue