From 9c10a094386674e714122cd6cccbf13ae888fbda Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 1 Nov 2023 12:23:48 -0400 Subject: [PATCH] Simplification --- core/src/mindustry/io/TypeIO.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/core/src/mindustry/io/TypeIO.java b/core/src/mindustry/io/TypeIO.java index 280ab3add6..d2db6b1e70 100644 --- a/core/src/mindustry/io/TypeIO.java +++ b/core/src/mindustry/io/TypeIO.java @@ -711,8 +711,7 @@ public class TypeIO{ } public static void writeStatus(Writes write, StatusEntry entry){ - //dynamic effects have the high bit of ID set to 1 - write.s(entry.effect.id | (entry.effect.dynamic ? 1 << 15 : 0)); + write.s(entry.effect.id); write.f(entry.time); //write dynamic fields @@ -742,13 +741,9 @@ public class TypeIO{ short id = read.s(); float time = read.f(); - StatusEntry result = new StatusEntry(); - - //check if it's dynamic (high bit set to 1), remove it, read multipliers - if((id & (1 << 15)) != 0){ - //it's a dynamic effect - id ^= (1 << 15); + StatusEntry result = new StatusEntry().set(content.getByID(ContentType.status, id), time); + if(result.effect.dynamic){ //read flags that store which fields are set int flags = read.ub(); @@ -761,8 +756,6 @@ public class TypeIO{ if((flags & (1 << 6)) != 0) result.armorOverride = read.f(); } - result.set(content.getByID(ContentType.status, id), time); - return result; }