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 09:36:29 -07:00
committed by GitHub
parent 77736f227f
commit bc3da30d45
4 changed files with 11 additions and 3 deletions

View File

@@ -53,7 +53,7 @@ public class Lightning{
world.raycastEach(World.toTile(from.getX()), World.toTile(from.getY()), World.toTile(to.getX()), World.toTile(to.getY()), (wx, wy) -> {
Tile tile = world.tile(wx, wy);
if(tile != null && tile.block().insulated && tile.team() != team){
if(tile != null && (tile.build != null && tile.build.isInsulated()) && tile.team() != team){
bhit = true;
//snap it instead of removing
lines.get(lines.size - 1).set(wx * tilesize, wy * tilesize);