mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-10-02 03:00:29 +03:00
Fixed #12626 (by disallowing dummies in payloads)
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user