From a6c3ebc46710e6fe1b82cd676a2a9f46c52640fb Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Thu, 4 Feb 2021 16:23:17 +0100 Subject: [PATCH] Save rotation of repair points (#4586) --- .../world/blocks/units/RepairPoint.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/core/src/mindustry/world/blocks/units/RepairPoint.java b/core/src/mindustry/world/blocks/units/RepairPoint.java index 64595c0902..80664cbee3 100644 --- a/core/src/mindustry/world/blocks/units/RepairPoint.java +++ b/core/src/mindustry/world/blocks/units/RepairPoint.java @@ -6,6 +6,7 @@ import arc.math.*; import arc.math.geom.*; import arc.struct.*; import arc.util.*; +import arc.util.io.*; import mindustry.annotations.Annotations.*; import mindustry.entities.*; import mindustry.gen.*; @@ -123,5 +124,26 @@ public class RepairPoint extends Block{ public BlockStatus status(){ return Mathf.equal(efficiency(), 0f, 0.01f) ? BlockStatus.noInput : cons.status(); } + + @Override + public void write(Writes write){ + super.write(write); + + write.f(rotation); + } + + @Override + public void read(Reads read, byte revision){ + super.read(read, revision); + + if(revision >= 1){ + rotation = read.f(); + } + } + + @Override + public byte version(){ + return 1; + } } }