From d71cae470ad6e6a2d54cf821911e29759cdc3882 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 12 Apr 2021 23:01:17 +1000 Subject: [PATCH] Fix GasOverlayData equals (#3834) Was never returning true. --- .../Atmos/SharedGasTileOverlaySystem.cs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/Content.Shared/GameObjects/EntitySystems/Atmos/SharedGasTileOverlaySystem.cs b/Content.Shared/GameObjects/EntitySystems/Atmos/SharedGasTileOverlaySystem.cs index ea0dd1d150..1869f0113b 100644 --- a/Content.Shared/GameObjects/EntitySystems/Atmos/SharedGasTileOverlaySystem.cs +++ b/Content.Shared/GameObjects/EntitySystems/Atmos/SharedGasTileOverlaySystem.cs @@ -76,22 +76,9 @@ namespace Content.Shared.GameObjects.EntitySystems.Atmos public bool Equals(GasOverlayData other) { - - if (HashCode != other.HashCode) return false; - if (Gas.Length != other.Gas.Length) return false; - if (FireState != other.FireState) return false; - if (MathHelper.CloseTo(FireTemperature, FireTemperature)) return false; - if (Gas.GetHashCode() != other.Gas.GetHashCode()) return false; - - for (var i = 0; i < Gas.Length; i++) - { - var gas = Gas[i]; - var otherGas = other.Gas[i]; - if (!gas.Equals(otherGas)) - return false; - } - - return true; + // If you revert this then you need to make sure the hash comparison between + // our Gas[] and the other.Gas[] works. + return HashCode == other.HashCode; } }