Fixed rare schematic crash

This commit is contained in:
Anuken 2021-03-29 15:06:06 -04:00
parent 4a9eeeeac3
commit ae8833e679
2 changed files with 10 additions and 2 deletions

View File

@ -351,7 +351,7 @@ public class Schematics implements Loadable{
Building linked = world.build(cx, cy);
Block realBlock = linked == null ? null : linked instanceof ConstructBuild cons ? cons.cblock : linked.block;
if(linked != null && (realBlock.isVisible() || realBlock instanceof CoreBlock)){
if(linked != null && realBlock != null && (realBlock.isVisible() || realBlock instanceof CoreBlock)){
int top = realBlock.size/2;
int bot = realBlock.size % 2 == 1 ? -realBlock.size/2 : -(realBlock.size - 1)/2;
minx = Math.min(linked.tileX() + bot, minx);
@ -380,7 +380,7 @@ public class Schematics implements Loadable{
Building tile = world.build(cx, cy);
Block realBlock = tile == null ? null : tile instanceof ConstructBuild cons ? cons.cblock : tile.block;
if(tile != null && !counted.contains(tile.pos())
if(tile != null && !counted.contains(tile.pos()) && realBlock != null
&& (realBlock.isVisible() || realBlock instanceof CoreBlock)){
Object config = tile instanceof ConstructBuild cons ? cons.lastConfig : tile.config();

View File

@ -0,0 +1,8 @@
[This is a truncated changelog, see Github for full notes]
- Fixed bridges being planned without unlock in campaign
- Fixed player moving slower on servers with status effects
- Fixed player not respecting formation speed on servers
- Fixed separators consuming power when idle
- Fixed logic blocks not saving buildings on reload
- Fixed rare door placement crash
- Fixed logic units being able to take/remove items from any team block