From: B_Kirill <153602297+B-Kirill@users.noreply.github.com> Date: Thu, 22 Jan 2026 22:22:22 +0000 (+1000) Subject: Fix construction ghost sprite offset (#42193) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=64f96e106986bbacdfc9b7720e0e96b2e9eb0008;p=space-station-14.git Fix construction ghost sprite offset (#42193) --- diff --git a/Content.Client/Construction/ConstructionSystem.cs b/Content.Client/Construction/ConstructionSystem.cs index 9900f860c3..e2010df12c 100644 --- a/Content.Client/Construction/ConstructionSystem.cs +++ b/Content.Client/Construction/ConstructionSystem.cs @@ -291,7 +291,6 @@ namespace Content.Client.Construction _ghosts.Add(comp.GhostId, ghost.Value); var sprite = Comp(ghost.Value); - _sprite.SetColor((ghost.Value, sprite), new Color(48, 255, 48, 128)); if (targetProto.TryGetComponent(out IconComponent? icon, EntityManager.ComponentFactory)) { @@ -306,22 +305,11 @@ namespace Content.Client.Construction var targetSprite = EnsureComp(dummy); EntityManager.System().OnChangeData(dummy, targetSprite); - var addedIndex = 0; - for (var i = 0; i < targetSprite.AllLayers.Count(); i++) - { - if (!targetSprite[i].Visible || !targetSprite[i].RsiState.IsValid) - continue; - - var rsi = targetSprite[i].Rsi ?? targetSprite.BaseRSI; - if (rsi is null || !rsi.TryGetState(targetSprite[i].RsiState, out var state) || - state.StateId.Name is null) - continue; + _sprite.CopySprite((dummy, targetSprite), (ghost.Value, sprite)); - _sprite.AddBlankLayer((ghost.Value, sprite), addedIndex); - _sprite.LayerSetSprite((ghost.Value, sprite), addedIndex, new SpriteSpecifier.Rsi(rsi.Path, state.StateId.Name)); - sprite.LayerSetShader(addedIndex, "unshaded"); - _sprite.LayerSetVisible((ghost.Value, sprite), addedIndex, true); - addedIndex++; + for (var i = 0; i < sprite.AllLayers.Count(); i++) + { + sprite.LayerSetShader(i, "unshaded"); } Del(dummy); @@ -329,6 +317,8 @@ namespace Content.Client.Construction else return false; + _sprite.SetColor((ghost.Value, sprite), new Color(48, 255, 48, 128)); + if (prototype.CanBuildInImpassable) EnsureComp(ghost.Value).Arc = new(Math.Tau);