Fixed #12626 (by disallowing dummies in payloads)

This commit is contained in:
Anuken
2026-09-11 01:38:27 -04:00
parent cc5a63109a
commit c6512c0b00
7 changed files with 16 additions and 11 deletions
@@ -4647,6 +4647,8 @@ public class UnitTypes{
useUnitCap = false;
killable = false;
physics = false;
internal = true;
internalGenerateSprites = true;
flyingLayer = Layer.flyingUnit - 1f;
drag = 0.33f;
@@ -1843,7 +1843,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
}
public boolean canPickup(){
return block.canPickup;
return block.allowedInPayloads;
}
/** Called right before this building is picked up. */
+4 -1
View File
@@ -67,6 +67,8 @@ public class Block extends UnlockableContent implements Senseable{
public boolean acceptsItems = false;
/** If true, this block won't be affected by the onlyDepositCore rule. */
public boolean alwaysAllowDeposit = false;
/** If false, this block cannot be placed in payloads. */
public boolean allowedInPayloads = true;
/** Cooldown, in seconds, applied to player item depositing when any item is deposited to this block. Overrides the itemDepositCooldown if non-negative. */
public float depositCooldown = -1f;
/** If true, all item capacities of this block are separate instead of pooled as one number. */
@@ -172,7 +174,8 @@ public class Block extends UnlockableContent implements Senseable{
public boolean updateInUnits = true;
/** if true, this block updates in payloads in units regardless of the experimental game rule */
public boolean alwaysUpdateInUnits = false;
/** if true, this block can be picked up in payloads */
/** @deprecated use allowedInPayloads instead */
@Deprecated
public boolean canPickup = true;
/** if false, only incinerable liquids are dropped when deconstructing; otherwise, all liquids are dropped. */
public boolean deconstructDropAllLiquid = false;
@@ -62,7 +62,7 @@ public class BaseShield extends Block{
hasPower = true;
update = solid = true;
rebuildable = false;
canPickup = true;
allowedInPayloads = false;
}
@Override
@@ -38,6 +38,7 @@ public class TargetDummy extends Block{
configurable = logicConfigurable = true;
underBullets = true;
targetable = false;
allowedInPayloads = false;
saveConfig = true;
@@ -90,6 +91,11 @@ public class TargetDummy extends Block{
public float unitArmor;
public Team unitTeam = Team.derelict;
@Override
public boolean canPickup(){
return false;
}
@Override
public void created(){
if(unitTeam == Team.derelict) unitTeam = team;
@@ -17,7 +17,6 @@ import mindustry.io.*;
import mindustry.type.*;
import mindustry.world.*;
import mindustry.world.blocks.*;
import mindustry.world.blocks.storage.*;
import static mindustry.Vars.*;
@@ -87,7 +86,7 @@ public class PayloadSource extends PayloadBlock{
}
public boolean canProduce(Block b){
return !b.removed && b.isVisible() && b.size < size && !(b instanceof CoreBlock) && !state.rules.isBanned(b) && b.environmentBuildable();
return !b.removed && b.isVisible() && b.size < size && b.allowedInPayloads && !state.rules.isBanned(b) && b.environmentBuildable();
}
public boolean canProduce(UnitType t){
@@ -83,6 +83,7 @@ public class CoreBlock extends StorageBlock{
envEnabled |= Env.space;
drawCached = false;
drawDynamic = true;
allowedInPayloads = false;
//support everything
replaceable = false;
@@ -673,12 +674,6 @@ public class CoreBlock extends StorageBlock{
}
}
@Override
public boolean canPickup(){
//cores can never be picked up
return false;
}
@Override
public void onDestroyed(){
if(state.rules.coreCapture){