Make IconSmoothComponent more failure-tolerant of the grid not being available (Fixes power stuff disappearing) (#4063)

This (hopefully) fixes power stuff disappearing by making IconSmoothComponent more failure-tolerant of grids not being available.
It might still leave issues in, though.
This commit is contained in:
20kdc
2021-05-23 19:18:36 +01:00
committed by GitHub
parent ff57833c84
commit 7598684e88
2 changed files with 37 additions and 16 deletions

View File

@@ -2,6 +2,7 @@ using Content.Client.GameObjects.Components.IconSmoothing;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
using Robust.Shared.Map;
using static Robust.Client.GameObjects.SpriteComponent;
namespace Content.Client.GameObjects.Components
@@ -35,11 +36,11 @@ namespace Content.Client.GameObjects.Components
}
}
internal override void CalculateNewSprite()
internal override void CalculateNewSprite(IMapGrid grid)
{
base.CalculateNewSprite();
base.CalculateNewSprite(grid);
var (cornerNE, cornerNW, cornerSW, cornerSE) = CalculateCornerFill();
var (cornerNE, cornerNW, cornerSW, cornerSE) = CalculateCornerFill(grid);
if (Sprite != null)
{