From 41413d65b7d7e6898f019444cfe3655cd405cc5d Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 9 May 2022 12:21:21 -0400 Subject: [PATCH 1/2] Do not allow cross-planet launch pads --- core/src/mindustry/game/Universe.java | 2 +- core/src/mindustry/world/Block.java | 1 + core/src/mindustry/world/blocks/campaign/LaunchPad.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/game/Universe.java b/core/src/mindustry/game/Universe.java index 39adf83536..eba7987876 100644 --- a/core/src/mindustry/game/Universe.java +++ b/core/src/mindustry/game/Universe.java @@ -163,7 +163,7 @@ public class Universe{ //export to another sector if(sector.info.destination != null){ Sector to = sector.info.destination; - if(to.hasBase()){ + if(to.hasBase() && to.planet == planet){ ItemSeq items = new ItemSeq(); //calculated exported items to this sector sector.info.export.each((item, stat) -> items.add(item, (int)(stat.mean * newSecondsPassed * sector.getProductionScale()))); diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 1ce0aa73f7..74cda8b373 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -621,6 +621,7 @@ public class Block extends UnlockableContent implements Senseable{ public boolean canReplace(Block other){ if(other.alwaysReplace) return true; + if(other.privileged) return false; return other.replaceable && (other != this || (rotate && quickRotate)) && this.group != BlockGroup.none && other.group == this.group && (size == other.size || (size >= other.size && ((subclass != null && subclass == other.subclass) || group.anyReplace))); } diff --git a/core/src/mindustry/world/blocks/campaign/LaunchPad.java b/core/src/mindustry/world/blocks/campaign/LaunchPad.java index 889553705a..062a0d80f1 100644 --- a/core/src/mindustry/world/blocks/campaign/LaunchPad.java +++ b/core/src/mindustry/world/blocks/campaign/LaunchPad.java @@ -168,7 +168,7 @@ public class LaunchPad extends Block{ table.button(Icon.upOpen, Styles.cleari, () -> { ui.planet.showSelect(state.rules.sector, other -> { - if(state.isCampaign()){ + if(state.isCampaign() && other.planet == state.rules.sector.planet){ state.rules.sector.info.destination = other; } }); From 0b141b6eb00d43449ca1fb8fff7caa0a4831581f Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 9 May 2022 12:51:05 -0400 Subject: [PATCH 2/2] more misc bugfixes --- core/src/mindustry/entities/comp/PayloadComp.java | 2 +- core/src/mindustry/graphics/MinimapRenderer.java | 4 ++++ core/src/mindustry/type/unit/MissileUnitType.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/comp/PayloadComp.java b/core/src/mindustry/entities/comp/PayloadComp.java index 0bb9d11fd5..a1121f4454 100644 --- a/core/src/mindustry/entities/comp/PayloadComp.java +++ b/core/src/mindustry/entities/comp/PayloadComp.java @@ -72,7 +72,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{ } boolean canPickupPayload(Payload pay){ - return payloadUsed() + pay.size()*pay.size() <= type.payloadCapacity + 0.001f; + return payloadUsed() + pay.size()*pay.size() <= type.payloadCapacity + 0.001f && (type.pickupUnits || !(pay instanceof UnitPayload)); } boolean hasPayload(){ diff --git a/core/src/mindustry/graphics/MinimapRenderer.java b/core/src/mindustry/graphics/MinimapRenderer.java index a8e0cf26ab..93871e917b 100644 --- a/core/src/mindustry/graphics/MinimapRenderer.java +++ b/core/src/mindustry/graphics/MinimapRenderer.java @@ -162,6 +162,10 @@ public class MinimapRenderer{ //crisp pixels dynamicTex.setFilter(TextureFilter.nearest); + if(worldSpace){ + region.set(0f, 0f, 1f, 1f); + } + Tmp.tr1.set(dynamicTex); Tmp.tr1.set(region.u, 1f - region.v, region.u2, 1f - region.v2); diff --git a/core/src/mindustry/type/unit/MissileUnitType.java b/core/src/mindustry/type/unit/MissileUnitType.java index 4e44eb92d9..8c83cb7a65 100644 --- a/core/src/mindustry/type/unit/MissileUnitType.java +++ b/core/src/mindustry/type/unit/MissileUnitType.java @@ -19,7 +19,7 @@ public class MissileUnitType extends UnitType{ isEnemy = false; useUnitCap = false; allowedInPayloads = false; - aiController = MissileAI::new; + controller = u -> new MissileAI(); flying = true; constructor = TimedKillUnit::create; envEnabled = Env.any;