From bba52e99e07a76c7c32de58fc0670a22ae52e2b4 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 25 Dec 2020 12:34:02 -0500 Subject: [PATCH] Fixed #4121 --- core/src/mindustry/io/TypeIO.java | 6 +++++- core/src/mindustry/world/blocks/power/NuclearReactor.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/io/TypeIO.java b/core/src/mindustry/io/TypeIO.java index d3172d378e..9e8ab187dd 100644 --- a/core/src/mindustry/io/TypeIO.java +++ b/core/src/mindustry/io/TypeIO.java @@ -317,7 +317,11 @@ public class TypeIO{ return player; }else if(type == 1){ //formation controller int id = read.i(); - return prev instanceof FormationAI ? prev : new FormationAI(Groups.unit.getByID(id), null); + if(prev instanceof FormationAI f){ + f.leader = Groups.unit.getByID(id); + return f; + } + return new FormationAI(Groups.unit.getByID(id), null); }else if(type == 3){ int pos = read.i(); if(prev instanceof LogicAI pai){ diff --git a/core/src/mindustry/world/blocks/power/NuclearReactor.java b/core/src/mindustry/world/blocks/power/NuclearReactor.java index 85fe183993..bbde62b3e7 100644 --- a/core/src/mindustry/world/blocks/power/NuclearReactor.java +++ b/core/src/mindustry/world/blocks/power/NuclearReactor.java @@ -100,7 +100,7 @@ public class NuclearReactor extends PowerGenerator{ float smoke = 1.0f + (heat - smokeThreshold) / (1f - smokeThreshold); //ranges from 1.0 to 2.0 if(Mathf.chance(smoke / 20.0 * delta())){ Fx.reactorsmoke.at(x + Mathf.range(size * tilesize / 2f), - y + Mathf.random(size * tilesize / 2f)); + y + Mathf.range(size * tilesize / 2f)); } }