From 2ff47fafc2ed6ef76a7921ddc00a294a0fc0b8f2 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 8 Nov 2019 23:02:50 -0500 Subject: [PATCH] fixed error in biome syncing code --- CalPlayer/CalamityPlayer.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 83f0d0391d..4f811d9a01 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1658,10 +1658,18 @@ namespace CalamityMod.CalPlayer public override bool CustomBiomesMatch(Player other) { CalamityPlayer modOther = other.Calamity(); - return ZoneCalamity == modOther.ZoneCalamity || ZoneAstral == modOther.ZoneAstral || ZoneAbyss == modOther.ZoneAbyss || - ZoneAbyssLayer1 == modOther.ZoneAbyssLayer1 || ZoneAbyssLayer2 == modOther.ZoneAbyssLayer2 || - ZoneAbyssLayer3 == modOther.ZoneAbyssLayer3 || ZoneAbyssLayer4 == modOther.ZoneAbyssLayer4 || - ZoneSulphur == modOther.ZoneSulphur || ZoneSunkenSea == modOther.ZoneSunkenSea; + + // efficiently short circuits to false if there are any discrepancies + // TODO -- order this list by how frequently players are in these various biomes + return ZoneSunkenSea == modOther.ZoneSunkenSea && + ZoneCalamity == modOther.ZoneCalamity && + ZoneAstral == modOther.ZoneAstral && + ZoneSulphur == modOther.ZoneSulphur && + ZoneAbyss == modOther.ZoneAbyss && + ZoneAbyssLayer1 == modOther.ZoneAbyssLayer1 && + ZoneAbyssLayer2 == modOther.ZoneAbyssLayer2 && + ZoneAbyssLayer3 == modOther.ZoneAbyssLayer3 && + ZoneAbyssLayer4 == modOther.ZoneAbyssLayer4; } public override void CopyCustomBiomesTo(Player other)