mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-06 02:40:23 -08:00
Sublimate collision fix
This commit is contained in:
parent
1465916bed
commit
536f4db5fe
6 changed files with 16 additions and 13 deletions
|
|
@ -4382,6 +4382,7 @@ public class Blocks{
|
|||
targetInterval = 5f;
|
||||
newTargetInterval = 30f;
|
||||
targetUnderBlocks = false;
|
||||
shootY = 7.5f;
|
||||
|
||||
float r = range = 130f;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue