Skip to content

Commit 5fe4b9a

Browse files
committed
alignment, comments
1 parent e1ffce2 commit 5fe4b9a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/mindustry/io/TypeIO.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,7 @@ public static Vec2 readVec2(Reads read){
711711
}
712712

713713
public static void writeStatus(Writes write, StatusEntry entry){
714+
//dynamic effects have the high bit of ID set to 1
714715
write.s(entry.effect.id | (entry.effect.dynamic ? 1 << 15 : 0));
715716
write.f(entry.time);
716717

@@ -724,7 +725,7 @@ public static void writeStatus(Writes write, StatusEntry entry){
724725
(entry.reloadMultiplier != 1f ? (1 << 3) : 0) |
725726
(entry.buildSpeedMultiplier != 1f ? (1 << 4) : 0) |
726727
(entry.dragMultiplier != 1f ? (1 << 5) : 0) |
727-
(entry.armorOverride >= 0f ? (1 << 6) : 0)
728+
(entry.armorOverride >= 0f ? (1 << 6) : 0)
728729
);
729730

730731
if(entry.damageMultiplier != 1f) write.f(entry.damageMultiplier);
@@ -743,6 +744,7 @@ public static StatusEntry readStatus(Reads read){
743744

744745
StatusEntry result = new StatusEntry();
745746

747+
//check if it's dynamic (high bit set to 1), remove it, read multipliers
746748
if((id & (1 << 15)) != 0){
747749
//it's a dynamic effect
748750
id ^= (1 << 15);

0 commit comments

Comments
 (0)