mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-20 17:28:14 +07:00
Core overfill bugfix
This commit is contained in:
parent
810238d0f9
commit
b63501b1c7
@ -19,6 +19,7 @@ import mindustry.graphics.*;
|
|||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||||
import mindustry.world.modules.*;
|
import mindustry.world.modules.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
@ -275,7 +276,7 @@ public class ConstructBlock extends Block{
|
|||||||
|
|
||||||
if(clampedAmount > 0 && accumulated > 0){ //if it's positive, add it to the core
|
if(clampedAmount > 0 && accumulated > 0){ //if it's positive, add it to the core
|
||||||
if(core != null && requirements[i].item.unlockedNow()){ //only accept items that are unlocked
|
if(core != null && requirements[i].item.unlockedNow()){ //only accept items that are unlocked
|
||||||
int accepting = core.acceptStack(requirements[i].item, accumulated, builder);
|
int accepting = Math.min(accumulated, ((CoreBuild)core).storageCapacity - core.items.get(requirements[i].item));
|
||||||
//transfer items directly, as this is not production.
|
//transfer items directly, as this is not production.
|
||||||
core.items.add(requirements[i].item, accepting);
|
core.items.add(requirements[i].item, accepting);
|
||||||
accumulator[i] -= accepting;
|
accumulator[i] -= accepting;
|
||||||
|
Loading…
Reference in New Issue
Block a user