Fixed #10769
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -54,6 +54,7 @@ public class ControlPathfinder implements Runnable{
|
|||||||
|
|
||||||
costLegs = (team, tile) ->
|
costLegs = (team, tile) ->
|
||||||
PathTile.legSolid(tile) ? impassable : 1 +
|
PathTile.legSolid(tile) ? impassable : 1 +
|
||||||
|
(PathTile.nearDeep(tile) ? 8 : 0) +
|
||||||
(PathTile.deep(tile) ? 6000 : 0) +
|
(PathTile.deep(tile) ? 6000 : 0) +
|
||||||
(PathTile.nearLegSolid(tile) ? 3 : 0),
|
(PathTile.nearLegSolid(tile) ? 3 : 0),
|
||||||
|
|
||||||
@@ -1425,9 +1426,7 @@ public class ControlPathfinder implements Runnable{
|
|||||||
|
|
||||||
private static boolean nearPassable(int team, PathCost cost, int pos){
|
private static boolean nearPassable(int team, PathCost cost, int pos){
|
||||||
int amount = cost.getCost(team, pathfinder.tiles[pos]);
|
int amount = cost.getCost(team, pathfinder.tiles[pos]);
|
||||||
//for standard units: never consider deep water (cost = 6000) passable
|
return amount != impassable && amount < 50;
|
||||||
//for leg units: consider it passable
|
|
||||||
return amount != impassable && amount < (cost == costLegs ? solidCap : 50);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean solid(int team, PathCost type, int x, int y){
|
private static boolean solid(int team, PathCost type, int x, int y){
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ public class Pathfinder implements Runnable{
|
|||||||
|
|
||||||
/** Packs a tile into its internal representation. */
|
/** Packs a tile into its internal representation. */
|
||||||
public int packTile(Tile tile){
|
public int packTile(Tile tile){
|
||||||
boolean nearLiquid = false, nearSolid = false, nearLegSolid = false, nearGround = false, solid = tile.solid(), allDeep = tile.floor().isDeep();
|
boolean nearLiquid = false, nearSolid = false, nearLegSolid = false, nearGround = false, solid = tile.solid(), allDeep = tile.floor().isDeep(), nearDeep = allDeep;
|
||||||
|
|
||||||
for(int i = 0; i < 4; i++){
|
for(int i = 0; i < 4; i++){
|
||||||
Tile other = tile.nearby(i);
|
Tile other = tile.nearby(i);
|
||||||
@@ -220,7 +220,11 @@ public class Pathfinder implements Runnable{
|
|||||||
//TODO potentially strange behavior when teamPassable is false for other teams?
|
//TODO potentially strange behavior when teamPassable is false for other teams?
|
||||||
if(osolid && !other.block().teamPassable) nearSolid = true;
|
if(osolid && !other.block().teamPassable) nearSolid = true;
|
||||||
if(!floor.isLiquid) nearGround = true;
|
if(!floor.isLiquid) nearGround = true;
|
||||||
if(!floor.isDeep()) allDeep = false;
|
if(!floor.isDeep()){
|
||||||
|
allDeep = false;
|
||||||
|
}else{
|
||||||
|
nearDeep = true;
|
||||||
|
}
|
||||||
if(other.legSolid()) nearLegSolid = true;
|
if(other.legSolid()) nearLegSolid = true;
|
||||||
|
|
||||||
//other tile is now near solid
|
//other tile is now near solid
|
||||||
@@ -245,6 +249,7 @@ public class Pathfinder implements Runnable{
|
|||||||
tile.floor().isDeep(),
|
tile.floor().isDeep(),
|
||||||
tile.floor().damageTaken > 0.00001f,
|
tile.floor().damageTaken > 0.00001f,
|
||||||
allDeep,
|
allDeep,
|
||||||
|
nearDeep,
|
||||||
tile.block().teamPassable
|
tile.block().teamPassable
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -699,6 +704,8 @@ public class Pathfinder implements Runnable{
|
|||||||
boolean damages;
|
boolean damages;
|
||||||
//whether all tiles nearby are deep
|
//whether all tiles nearby are deep
|
||||||
boolean allDeep;
|
boolean allDeep;
|
||||||
|
//whether it is near deep water
|
||||||
|
boolean nearDeep;
|
||||||
//block teamPassable is true
|
//block teamPassable is true
|
||||||
boolean teamPassable;
|
boolean teamPassable;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,8 +164,6 @@ public class WaveSpawner{
|
|||||||
cons.accept(core.x + Tmp.v1.x, core.y + Tmp.v1.y, false);
|
cons.accept(core.x + Tmp.v1.x, core.y + Tmp.v1.y, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import mindustry.ctype.*;
|
|||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
import mindustry.io.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
import mindustry.world.blocks.*;
|
import mindustry.world.blocks.*;
|
||||||
@@ -163,11 +164,17 @@ public class PayloadSource extends PayloadBlock{
|
|||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public byte version(){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(Writes write){
|
public void write(Writes write){
|
||||||
super.write(write);
|
super.write(write);
|
||||||
write.s(unit == null ? -1 : unit.id);
|
write.s(unit == null ? -1 : unit.id);
|
||||||
write.s(configBlock == null ? -1 : configBlock.id);
|
write.s(configBlock == null ? -1 : configBlock.id);
|
||||||
|
TypeIO.writeVecNullable(write, commandPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -175,6 +182,9 @@ public class PayloadSource extends PayloadBlock{
|
|||||||
super.read(read, revision);
|
super.read(read, revision);
|
||||||
unit = Vars.content.unit(read.s());
|
unit = Vars.content.unit(read.s());
|
||||||
configBlock = Vars.content.block(read.s());
|
configBlock = Vars.content.block(read.s());
|
||||||
|
if(revision >= 1){
|
||||||
|
commandPos = TypeIO.readVecNullable(read);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user