Фиксы багов (#3473)
This commit is contained in:
parent
af5b424a2c
commit
59e28ef265
7 changed files with 43 additions and 10 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue