Фиксы багов (#3473)

This commit is contained in:
iertis 2025-12-19 09:44:35 +05:00 committed by GitHub
parent af5b424a2c
commit 59e28ef265
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 43 additions and 10 deletions

View file

@ -14,6 +14,7 @@ using Content.Shared.Movement.Systems;
using Robust.Shared.Audio;
using Robust.Shared.Timing;
using Robust.Shared.Player;
using Content.Server._Starlight.Medical.Limbs;
namespace Content.Server.Body.Systems;
@ -25,6 +26,7 @@ public sealed class BodySystem : SharedBodySystem
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly SharedMindSystem _mindSystem = default!;
[Dependency] private readonly ISharedPlayerManager _player = default!;
[Dependency] private readonly LimbSystem _limbSystem = default!;//🌟Starlight🌟
public override void Initialize()
{
@ -74,6 +76,9 @@ public sealed class BodySystem : SharedBodySystem
var layers = HumanoidVisualLayersExtension.Sublayers(layer.Value);
_humanoidSystem.SetLayersVisibility(bodyEnt.Owner, layers, visible: true);
}
if (TryComp<HumanoidAppearanceComponent>(bodyEnt, out var humanoid))
_limbSystem.AddLimbVisual((bodyEnt, humanoid), partEnt); //🌟Starlight🌟
}
protected override void RemovePart(

View file

@ -30,12 +30,18 @@ public sealed class EmoteAnimationSystem : EntitySystem
{
SubscribeLocalEvent<EmoteAnimationComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<EmoteAnimationComponent, EmoteEvent>(OnEmote);
SubscribeLocalEvent<EmoteAnimationComponent, PlayEmoteMessage>(OnPlayEmote);
SubscribeAllEvent<PlayEmoteMessage>(OnPlayEmote);
}
private void OnPlayEmote(EntityUid uid, EmoteAnimationComponent component, PlayEmoteMessage args)
private void OnPlayEmote(PlayEmoteMessage msg, EntitySessionEventArgs args)
{
if (!_prototypeManager.TryIndex(args.ProtoId, out var proto))
if (args.SenderSession.AttachedEntity is not {} uid)
return;
if (!HasComp<EmoteAnimationComponent>(uid))
return;
if (!_prototypeManager.TryIndex(msg.ProtoId, out var proto))
return;
_chat.TryEmoteWithChat(uid, proto.ID);

View file

@ -127,7 +127,7 @@ public sealed class CryoTeleportationSystem : EntitySystem
var container = _container.EnsureContainer<ContainerSlot>(cryoStorage.Value, "storage");
if (!_container.Insert(uid, container))
if (_container.Insert(uid, container))
_cryostorage.HandleEnterCryostorage((uid, containedComp), comp.UserId);
}
}

View file

@ -118,7 +118,7 @@ public sealed class DiseaseRoleSystem : SharedDiseaseRoleSystem
infoText.AppendLine("├─ " + Loc.GetString("disease-info-infected-count") + ": " + component.Infected.Count);
infoText.Append("└─ " + Loc.GetString("disease-info-total-infected") + ": " + component.SickOfAllTime);
_popup.PopupEntity(infoText.ToString(), uid, PopupType.Large);
_popup.PopupEntity(infoText.ToString(), uid, uid, PopupType.Large);
}

View file

@ -352,7 +352,7 @@ namespace Content.Shared.Cuffs
if (!args.Cancelled && TryAddNewCuffs(target, user, uid, cuffable))
{
// component.Used = true; // Starlight-Abductor edit
component.Used = true;
_audio.PlayPredicted(component.EndCuffSound, uid, user);
var popupText = (user == target)

View file

@ -1,6 +1,8 @@
using Content.Shared.Body.Part;
using Content.Shared.Body.Systems;
using Content.Shared.Buckle.Components;
using Content.Shared.DoAfter;
using Content.Shared.Interaction;
using Content.Shared.Inventory;
using Content.Shared.Item;
using Content.Shared.Item.ItemToggle.Components;
@ -24,6 +26,7 @@ public abstract partial class SharedSurgerySystem
SubscribeLocalEvent<SurgeryClearProgressComponent, SurgeryStepCompleteEvent>(OnClearProgressStep);
SubscribeLocalEvent<SurgeryStepComponent, SurgeryStepEvent>(OnStep);
SubscribeLocalEvent<SurgeryTargetComponent, SurgeryDoAfterEvent>(OnTargetDoAfter);
SubscribeLocalEvent<SurgeryTargetComponent, AccessibleOverrideEvent>(OnOverrideAccess);
SubscribeLocalEvent<SurgeryStepComponent, SurgeryCanPerformStepEvent>(OnCanPerformStep);
@ -71,6 +74,24 @@ public abstract partial class SharedSurgerySystem
RefreshUI(ent);
}
private void OnOverrideAccess(Entity<SurgeryTargetComponent> ent, ref AccessibleOverrideEvent args)
{
// Check if the entity is the target to avoid giving the hooked entity access to everything.
// If we already have access we don't need to run more code.
if (args.Accessible || args.Target != ent.Owner)
return;
var xform = Transform(ent);
var root = _containers.GetContainingContainers((ent, xform)).FirstOrDefault(x => x.ID == SharedBodySystem.BodyRootContainerId); //get the root container
if (root == null)
return;
if (!_interaction.CanAccess(args.User, root.Owner))
return;
args.Accessible = true;
args.Handled = true;
}
private void OnClearProgressStep(Entity<SurgeryClearProgressComponent> ent, ref SurgeryStepCompleteEvent args)
{
var progress = Comp<SurgeryProgressComponent>(args.Part);
@ -148,7 +169,7 @@ public abstract partial class SharedSurgerySystem
if (args.Invalid != StepInvalidReason.None)
return;
if (_inventory.TryGetContainerSlotEnumerator(args.Body, out var enumerator, args.TargetSlots))
{
var items = 0f;
@ -270,7 +291,7 @@ public abstract partial class SharedSurgerySystem
foreach (var requirementId in requirementsIds)
{
if (!_entitySystem.TryGetSingleton(requirementId, out var requirement)
&& GetNextStep(body, part, requirement, requirements) is { } requiredNext
&& GetNextStep(body, part, requirement, requirements) is { } requiredNext
&& IsSurgeryValid(body, part, requirementId, requiredNext.Surgery.Comp.Steps[requiredNext.Step], out _, out _, out _))
return requiredNext;
}
@ -296,8 +317,8 @@ public abstract partial class SharedSurgerySystem
foreach (var requirement in requirements)
{
if (!_entitySystem.TryGetSingleton(requirement, out var requiredEnt)
|| !TryComp(requiredEnt, out SurgeryComponent? requiredComp)
|| !PreviousStepsComplete(body, part, (requiredEnt, requiredComp), step)
|| !TryComp(requiredEnt, out SurgeryComponent? requiredComp)
|| !PreviousStepsComplete(body, part, (requiredEnt, requiredComp), step)
&& IsSurgeryValid(body, part, requirement, step, out _, out _, out _))
return false;
}

View file

@ -49,6 +49,7 @@ public abstract partial class SharedSurgerySystem : EntitySystem
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly SharedItemSystem _item = default!;
[Dependency] private readonly StarlightEntitySystem _entitySystem = default!;
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
public override void Initialize()
{