Allow for dynamic laser absorption and insulation (#5047)

* Allow for dynamic laser absorption

* Might as well do insulated as well

* null checks are important
This commit is contained in:
Matthew Peng
2021-10-05 12:36:29 -04:00
committed by GitHub
parent 77736f227f
commit bc3da30d45
4 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ public class Damage{
furthest = null;
boolean found = world.raycast(b.tileX(), b.tileY(), World.toTile(b.x + Tmp.v1.x), World.toTile(b.y + Tmp.v1.y),
(x, y) -> (furthest = world.tile(x, y)) != null && furthest.team() != b.team && furthest.block().absorbLasers);
(x, y) -> (furthest = world.tile(x, y)) != null && furthest.team() != b.team && (furthest.build != null && furthest.build.absorbLasers()));
return found && furthest != null ? Math.max(6f, b.dst(furthest.worldx(), furthest.worldy())) : length;
}