Fix gas overlay (#12692)
This commit is contained in:
@@ -130,9 +130,17 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var changed = oldData.Equals(default) || oldData.FireState != tile.Hotspot.State;
|
var changed = false;
|
||||||
if (oldData.Equals(default))
|
if (oldData.Equals(default))
|
||||||
|
{
|
||||||
|
changed = true;
|
||||||
oldData = new GasOverlayData(tile.Hotspot.State, new byte[VisibleGasId.Length]);
|
oldData = new GasOverlayData(tile.Hotspot.State, new byte[VisibleGasId.Length]);
|
||||||
|
}
|
||||||
|
else if (oldData.FireState != tile.Hotspot.State)
|
||||||
|
{
|
||||||
|
changed = true;
|
||||||
|
oldData = new GasOverlayData(tile.Hotspot.State, oldData.Opacity);
|
||||||
|
}
|
||||||
|
|
||||||
if (tile.Air != null)
|
if (tile.Air != null)
|
||||||
{
|
{
|
||||||
@@ -166,6 +174,14 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (var i = 0; i < VisibleGasId.Length; i++)
|
||||||
|
{
|
||||||
|
changed |= oldData.Opacity[i] != 0;
|
||||||
|
oldData.Opacity[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!changed)
|
if (!changed)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user