From 536f4db5fe5b91f455c9b904b8572d3399819c27 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 17 Jun 2025 11:20:21 -0400 Subject: [PATCH] Sublimate collision fix --- core/src/mindustry/content/Blocks.java | 1 + core/src/mindustry/entities/Damage.java | 16 ++++++++-------- .../entities/bullet/ContinuousBulletType.java | 2 +- .../entities/bullet/RailBulletType.java | 2 +- core/src/mindustry/io/MapIO.java | 6 ++++-- gradle.properties | 2 +- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 48c2ebd1d5..a90ba05e77 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -4382,6 +4382,7 @@ public class Blocks{ targetInterval = 5f; newTargetInterval = 30f; targetUnderBlocks = false; + shootY = 7.5f; float r = range = 130f; diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 767a7ace78..a3fcd86e8f 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -222,38 +222,38 @@ public class Damage{ public static float collideLaser(Bullet b, float length, boolean large, boolean laser, int pierceCap){ float resultLength = findPierceLength(b, pierceCap, laser, length); - collideLine(b, b.team, b.type.hitEffect, b.x, b.y, b.rotation(), resultLength, large, laser, pierceCap); + collideLine(b, b.team, b.x, b.y, b.rotation(), resultLength, large, laser, pierceCap); b.fdata = resultLength; return resultLength; } - public static void collideLine(Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length){ - collideLine(hitter, team, effect, x, y, angle, length, false); + public static void collideLine(Bullet hitter, Team team, float x, float y, float angle, float length){ + collideLine(hitter, team, x, y, angle, length, false); } /** * Damages entities in a line. * Only enemies of the specified team are damaged. */ - public static void collideLine(Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length, boolean large){ - collideLine(hitter, team, effect, x, y, angle, length, large, true); + public static void collideLine(Bullet hitter, Team team, float x, float y, float angle, float length, boolean large){ + collideLine(hitter, team, x, y, angle, length, large, true); } /** * Damages entities in a line. * Only enemies of the specified team are damaged. */ - public static void collideLine(Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length, boolean large, boolean laser){ - collideLine(hitter, team, effect, x, y, angle, length, large, laser, -1); + public static void collideLine(Bullet hitter, Team team, float x, float y, float angle, float length, boolean large, boolean laser){ + collideLine(hitter, team, x, y, angle, length, large, laser, -1); } /** * Damages entities in a line. * Only enemies of the specified team are damaged. */ - public static void collideLine(Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length, boolean large, boolean laser, int pierceCap){ + public static void collideLine(Bullet hitter, Team team, float x, float y, float angle, float length, boolean large, boolean laser, int pierceCap){ length = findLength(hitter, length, laser, pierceCap); hitter.fdata = length; diff --git a/core/src/mindustry/entities/bullet/ContinuousBulletType.java b/core/src/mindustry/entities/bullet/ContinuousBulletType.java index a9ea18876b..9dfb85ad25 100644 --- a/core/src/mindustry/entities/bullet/ContinuousBulletType.java +++ b/core/src/mindustry/entities/bullet/ContinuousBulletType.java @@ -85,7 +85,7 @@ public class ContinuousBulletType extends BulletType{ if(timescaleDamage && b.owner instanceof Building build){ b.damage *= build.timeScale(); } - Damage.collideLine(b, b.team, hitEffect, b.x, b.y, b.rotation(), currentLength(b), largeHit, laserAbsorb, pierceCap); + Damage.collideLine(b, b.team, b.x, b.y, b.rotation(), currentLength(b), largeHit, laserAbsorb, pierceCap); b.damage = damage; } diff --git a/core/src/mindustry/entities/bullet/RailBulletType.java b/core/src/mindustry/entities/bullet/RailBulletType.java index dfa41520f4..ea5f336d22 100644 --- a/core/src/mindustry/entities/bullet/RailBulletType.java +++ b/core/src/mindustry/entities/bullet/RailBulletType.java @@ -59,7 +59,7 @@ public class RailBulletType extends BulletType{ super.init(b); b.fdata = length; - Damage.collideLine(b, b.team, b.type.hitEffect, b.x, b.y, b.rotation(), length, false, false, pierceCap); + Damage.collideLine(b, b.team, b.x, b.y, b.rotation(), length, false, false, pierceCap); float resultLen = b.fdata; Vec2 nor = Tmp.v1.trns(b.rotation(), 1f).nor(); diff --git a/core/src/mindustry/io/MapIO.java b/core/src/mindustry/io/MapIO.java index 172118097a..26cc9cd8ac 100644 --- a/core/src/mindustry/io/MapIO.java +++ b/core/src/mindustry/io/MapIO.java @@ -172,7 +172,7 @@ public class MapIO{ for(Tile tile : tiles){ //while synthetic blocks are possible, most of their data is lost, so in order to avoid questions like //"why is there air under my drill" and "why are all my conveyors facing right", they are disabled - int color = tile.block().hasColor && !tile.block().synthetic() ? tile.block().mapColor.rgba() : tile.floor().mapColor.rgba(); + int color = tile.block().hasColor && !tile.block().hasBuilding() ? tile.block().mapColor.rgba() : tile.floor().mapColor.rgba(); pix.set(tile.x, tiles.height - 1 - tile.y, color); } return pix; @@ -183,6 +183,9 @@ public class MapIO{ int color = pixmap.get(tile.x, pixmap.height - 1 - tile.y); Block block = ColorMapper.get(color); + //ignore buildings; reading images is only intended for environment tiles + if(block.hasBuilding()) continue; + if(block.isOverlay()){ tile.setOverlay(block.asFloor()); }else if(block.isFloor()){ @@ -194,7 +197,6 @@ public class MapIO{ } } - //guess at floors by grabbing a random adjacent floor for(Tile tile : tiles){ //default to stone floor if(tile.floor() == Blocks.air){ diff --git a/gradle.properties b/gradle.properties index dffe670de1..ce43e41c4b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,4 +26,4 @@ org.gradle.caching=true org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 android.enableR8.fullMode=false -archash=8abaedb419 +archash=79c4cf021d