diff --git a/Content.Shared/Backmen/Surgery/Body/SharedBodySystem.PartAppearance.cs b/Content.Shared/Backmen/Surgery/Body/SharedBodySystem.PartAppearance.cs index 166c5340d2f..e2fa22118a9 100644 --- a/Content.Shared/Backmen/Surgery/Body/SharedBodySystem.PartAppearance.cs +++ b/Content.Shared/Backmen/Surgery/Body/SharedBodySystem.PartAppearance.cs @@ -7,7 +7,6 @@ using Robust.Shared.Prototypes; using Content.Shared.Backmen.Surgery.Body.Events; - // ReSharper disable once CheckNamespace namespace Content.Shared.Body.Systems; @@ -30,13 +29,14 @@ private void OnPartAppearanceStartup(EntityUid uid, BodyPartAppearanceComponent { if (!TryComp(uid, out BodyPartComponent? part) || part.ToHumanoidLayers() is not { } relevantLayer) + return; if (part.OriginalBody == null || TerminatingOrDeleted(part.OriginalBody.Value) || !TryComp(part.OriginalBody.Value, out HumanoidAppearanceComponent? bodyAppearance)) { - //component.ID = part.BaseLayerId; + component.ID = part.BaseLayerId; component.Type = relevantLayer; return; } @@ -74,8 +74,7 @@ private void OnPartAppearanceStartup(EntityUid uid, BodyPartAppearanceComponent { var category = MarkingCategoriesConversion.FromHumanoidVisualLayers(layer); if (bodyAppearance.MarkingSet.Markings.TryGetValue(category, out var markingList)) - markingsByLayer[layer] = - markingList.Select(m => new Marking(m.MarkingId, m.MarkingColors.ToList())).ToList(); + markingsByLayer[layer] = markingList.Select(m => new Marking(m.MarkingId, m.MarkingColors.ToList())).ToList(); } component.Markings = markingsByLayer; @@ -147,10 +146,17 @@ private void OnPartAttachedToBody(EntityUid uid, BodyComponent component, ref Bo private void OnPartDroppedFromBody(EntityUid uid, BodyComponent component, ref BodyPartRemovedEvent args) { if (TerminatingOrDeleted(uid) - || !TryComp(args.Part, out BodyPartAppearanceComponent? appearance)) + || TerminatingOrDeleted(args.Part) + || !TryComp(uid, out HumanoidAppearanceComponent? bodyAppearance)) return; - RemoveAppearance(uid, appearance, args.Part); + // We check for this conditional here since some entities may not have a profile... If they dont + // have one, and their part is gibbed, the markings will not be removed or applied properly. + if (!HasComp(args.Part)) + EnsureComp(args.Part); + + if (TryComp(args.Part, out var partAppearance)) + RemoveAppearance(uid, partAppearance, args.Part); } protected void UpdateAppearance(EntityUid target, @@ -160,10 +166,7 @@ protected void UpdateAppearance(EntityUid target, return; if (component.EyeColor != null) - { bodyAppearance.EyeColor = component.EyeColor.Value; - _humanoid.SetLayerVisibility(target, HumanoidVisualLayers.Eyes, true, true, bodyAppearance); - } if (component.Color != null) _humanoid.SetBaseLayerColor(target, component.Type, component.Color, true, bodyAppearance); @@ -174,9 +177,7 @@ protected void UpdateAppearance(EntityUid target, { _humanoid.SetLayerVisibility(target, visualLayer, true, true, bodyAppearance); foreach (var marking in markingList) - { - _humanoid.AddMarking(target, marking.MarkingId, marking.MarkingColors, true, true, bodyAppearance); - } + _humanoid.AddMarking(target, marking.MarkingId, marking.MarkingColors, false, true, bodyAppearance); } Dirty(target, bodyAppearance); diff --git a/Content.Shared/Backmen/Surgery/Tools/BoneSawComponent.cs b/Content.Shared/Backmen/Surgery/Tools/BoneSawComponent.cs index 75bf3ad2233..0a70093341c 100644 --- a/Content.Shared/Backmen/Surgery/Tools/BoneSawComponent.cs +++ b/Content.Shared/Backmen/Surgery/Tools/BoneSawComponent.cs @@ -8,5 +8,5 @@ public sealed partial class BoneSawComponent : Component, ISurgeryToolComponent public string ToolName => "a bone saw"; public bool? Used { get; set; } = null; [DataField] - public float Speed { get; set; } + public float Speed { get; set; } = 1f; } diff --git a/Content.Shared/Body/Systems/SharedBodySystem.Body.cs b/Content.Shared/Body/Systems/SharedBodySystem.Body.cs index a6b54ed9dda..7cdc088160b 100644 --- a/Content.Shared/Body/Systems/SharedBodySystem.Body.cs +++ b/Content.Shared/Body/Systems/SharedBodySystem.Body.cs @@ -395,9 +395,8 @@ public virtual HashSet GibPart( return gibs; ChangeSlotState((partId, part), true); - RemovePartChildren((partId, part), bodyEnt); - // We have to iterate though every organ to drop it when part is being destroyed + RemovePartChildren((partId, part), bodyEnt); foreach (var organ in GetPartOrgans(partId, part)) { _gibbingSystem.TryGibEntityWithRef(bodyEnt, organ.Id, GibType.Drop, GibContentsOption.Skip, @@ -410,15 +409,15 @@ public virtual HashSet GibPart( playAudio: true, launchGibs: true, launchDirection: splatDirection, launchImpulse: GibletLaunchImpulse * splatModifier, launchImpulseVariance: GibletLaunchImpulseVariance, launchCone: splatCone); + if (HasComp(partId)) { - foreach (var item in _inventory.GetHandOrInventoryEntities((partId))) + foreach (var item in _inventory.GetHandOrInventoryEntities(partId)) { SharedTransform.AttachToGridOrMap(item); gibs.Add(item); } } - _audioSystem.PlayPredicted(gibSoundOverride, Transform(partId).Coordinates, null); return gibs; } @@ -450,8 +449,6 @@ private void OnProfileLoadFinished(EntityUid uid, BodyComponent component, Profi return; foreach (var part in GetBodyChildren(uid, component)) - { EnsureComp(part.Id); - } } } diff --git a/Resources/keybinds.yml b/Resources/keybinds.yml index 5cc9472241e..953576f69b5 100644 --- a/Resources/keybinds.yml +++ b/Resources/keybinds.yml @@ -70,18 +70,23 @@ binds: - function: CameraRotateLeft type: State key: NumpadNum7 + mod1: Control - function: CameraRotateRight type: State key: NumpadNum9 + mod1: Control - function: CameraReset type: State key: NumpadNum8 + mod1: Control - function: ZoomOut type: State key: NumpadNum4 + mod1: Control - function: ZoomIn type: State key: NumpadNum6 + mod1: Control - function: ResetZoom type: State key: NumpadNum5