mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-04-27 16:00:51 -07:00
Fixed #4680
This commit is contained in:
parent
e16622afcc
commit
fa52255d04
3 changed files with 14 additions and 9 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package mindustry.ai.types;
|
||||
|
||||
import arc.math.geom.*;
|
||||
import mindustry.*;
|
||||
import mindustry.ai.*;
|
||||
import mindustry.entities.*;
|
||||
|
|
@ -47,14 +48,17 @@ public class SuicideAI extends GroundAI{
|
|||
|
||||
//raycast for target
|
||||
boolean blocked = Vars.world.raycast(unit.tileX(), unit.tileY(), target.tileX(), target.tileY(), (x, y) -> {
|
||||
Tile tile = Vars.world.tile(x, y);
|
||||
if(tile != null && tile.build == target) return false;
|
||||
if(tile != null && tile.build != null && tile.build.team != unit.team()){
|
||||
blockedByBlock = true;
|
||||
return true;
|
||||
}else{
|
||||
return tile == null || tile.solid();
|
||||
for(Point2 p : Geometry.d4c){
|
||||
Tile tile = Vars.world.tile(x + p.x, y + p.y);
|
||||
if(tile != null && tile.build == target) return false;
|
||||
if(tile != null && tile.build != null && tile.build.team != unit.team()){
|
||||
blockedByBlock = true;
|
||||
return true;
|
||||
}else{
|
||||
return tile == null || tile.solid();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//shoot when there's an enemy block in the way
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ public class ConsumeLiquidFilter extends ConsumeLiquidBase{
|
|||
public void build(Building build, Table table){
|
||||
Seq<Liquid> list = content.liquids().select(l -> !l.isHidden() && filter.get(l));
|
||||
MultiReqImage image = new MultiReqImage();
|
||||
list.each(liquid -> image.add(new ReqImage(liquid.icon(Cicon.medium), () -> build.liquids != null && build.liquids.get(liquid) >= Math.max(use(build), amount * build.delta()))));
|
||||
list.each(liquid -> image.add(new ReqImage(liquid.icon(Cicon.medium), () ->
|
||||
build.liquids != null && build.liquids.current() == liquid && build.liquids.get(liquid) >= Math.max(use(build), amount * build.delta()))));
|
||||
|
||||
table.add(image).size(8 * 4);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=f49f7c824adc556cba6b94579c6b0d4e24574b3e
|
||||
archash=40c4e9db40cb8fbe7daa091f20ca0bf5acfd8484
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue