diff --git a/Content.Client/Effects/ColorFlashEffectSystem.cs b/Content.Client/Effects/ColorFlashEffectSystem.cs index af0bd4b600..3a66cb72e9 100644 --- a/Content.Client/Effects/ColorFlashEffectSystem.cs +++ b/Content.Client/Effects/ColorFlashEffectSystem.cs @@ -45,7 +45,9 @@ private void OnEffectAnimationCompleted(EntityUid uid, ColorFlashEffectComponent sprite.Color = component.Color; } - RemCompDeferred(uid); + // Floof - commented this out due to a race condition. It's quite complicated to explain; + // in short terms, don't do deferred component removal when dealing with concurrent tasks concerning the same component. + // RemCompDeferred(uid); } private Animation? GetDamageAnimation(EntityUid uid, Color color, SpriteComponent? sprite = null) @@ -107,10 +109,11 @@ private void OnColorFlashEffect(ColorFlashEffectEvent ev) continue; } - if (TryComp(ent, out var effect)) - { - sprite.Color = effect.Color; - } + // Floof - commented out. This is handled by the animation complete event. + // if (TryComp(ent, out var effect)) + // { + // sprite.Color = effect.Color; + // } var animation = GetDamageAnimation(ent, color, sprite); diff --git a/Content.Server/Carrying/CarryingSystem.cs b/Content.Server/Carrying/CarryingSystem.cs index cf7e37f5c4..d206e35d2b 100644 --- a/Content.Server/Carrying/CarryingSystem.cs +++ b/Content.Server/Carrying/CarryingSystem.cs @@ -272,6 +272,7 @@ private void Carry(EntityUid carrier, EntityUid carried) if (TryComp(carried, out var pullable)) _pullingSystem.TryStopPull(carried, pullable); + EnsureComp(carried); // Floof - moved this statement up because some systems can break carrying in response to knockdown _transform.AttachToGridOrMap(carrier); _transform.AttachToGridOrMap(carried); _transform.SetCoordinates(carried, Transform(carrier).Coordinates); @@ -281,7 +282,6 @@ private void Carry(EntityUid carrier, EntityUid carried) var carryingComp = EnsureComp(carrier); ApplyCarrySlowdown(carrier, carried); var carriedComp = EnsureComp(carried); - EnsureComp(carried); carryingComp.Carried = carried; carriedComp.Carrier = carrier; diff --git a/Content.Server/FootPrint/PuddleFootPrintsSystem.cs b/Content.Server/FootPrint/PuddleFootPrintsSystem.cs index a778bcf2c7..6b0d286c69 100644 --- a/Content.Server/FootPrint/PuddleFootPrintsSystem.cs +++ b/Content.Server/FootPrint/PuddleFootPrintsSystem.cs @@ -9,6 +9,7 @@ namespace Content.Server.FootPrint; +// Floof: this system has been effectively rewritten. DO NOT MERGE UPSTREAM CHANGES. public sealed class PuddleFootPrintsSystem : EntitySystem { [Dependency] private readonly IPrototypeManager _protoMan = default!; diff --git a/Content.Server/Instruments/InstrumentSystem.cs b/Content.Server/Instruments/InstrumentSystem.cs index f5a6713886..d45fdd11f2 100644 --- a/Content.Server/Instruments/InstrumentSystem.cs +++ b/Content.Server/Instruments/InstrumentSystem.cs @@ -252,7 +252,8 @@ private void OnBoundUIRequestBands(EntityUid uid, InstrumentComponent component, // Maybe a bit expensive but oh well GetBands is queued and has a timer anyway. // Make sure the instrument is visible, uses the Opaque collision group so this works across windows etc. if (!_interactions.InRangeUnobstructed(uid, entity, MaxInstrumentBandRange, - CollisionGroup.Opaque, e => e == playerUid || e == originPlayer)) + CollisionGroup.Opaque, + e => e == playerUid || e == originPlayer || !HasComp(e))) // Floof - added the occluder check. continue; if (!metadataQuery.TryGetComponent(playerUid, out var playerMetadata) diff --git a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Storage.cs b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Storage.cs index a9a07c287b..000f6318aa 100644 --- a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Storage.cs +++ b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Storage.cs @@ -80,7 +80,7 @@ private void OnInteractUsing(EntityUid uid, DeepFryerComponent component, Intera private void OnInsertItem(EntityUid uid, DeepFryerComponent component, DeepFryerInsertItemMessage args) { - var user = EntityManager.GetEntity(args.Entity); + var user = args.Actor; // Floof - fix if (!TryComp(user, out var handsComponent) || handsComponent.ActiveHandEntity == null) diff --git a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs index ec1b81cfb3..83bef4f0f0 100644 --- a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs +++ b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs @@ -548,7 +548,7 @@ private void OnRemoveItem(EntityUid uid, DeepFryerComponent component, DeepFryer if (!_containerSystem.Remove(removedItem, component.Storage)) return; - var user = EntityManager.GetEntity(args.Entity); + var user = args.Actor; // Floof - fix; _handsSystem.TryPickupAnyHand(user, removedItem); @@ -601,7 +601,7 @@ private bool TryGetActiveHandSolutionContainer( private void OnScoopVat(EntityUid uid, DeepFryerComponent component, DeepFryerScoopVatMessage args) { - var user = EntityManager.GetEntity(args.Entity); + var user = args.Actor; // Floof - fix if (!TryGetActiveHandSolutionContainer(uid, user, out var heldItem, out var heldSolution, out var transferAmount)) @@ -622,7 +622,7 @@ private void OnScoopVat(EntityUid uid, DeepFryerComponent component, DeepFryerSc private void OnClearSlagStart(EntityUid uid, DeepFryerComponent component, DeepFryerClearSlagMessage args) { - var user = EntityManager.GetEntity(args.Entity); + var user = args.Actor; // Floof - fix if (!TryGetActiveHandSolutionContainer(uid, user, out var heldItem, out var heldSolution, out var transferAmount)) @@ -662,7 +662,7 @@ private void OnRemoveAllItems(EntityUid uid, DeepFryerComponent component, DeepF _containerSystem.EmptyContainer(component.Storage); - var user = EntityManager.GetEntity(args.Entity); + var user = args.Actor; // Floof - fix _adminLogManager.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user)} removed all items from {ToPrettyString(uid)}."); diff --git a/Content.Shared/Floofstation/Leash/LeashSystem.cs b/Content.Shared/Floofstation/Leash/LeashSystem.cs index df17052fad..a66d313886 100644 --- a/Content.Shared/Floofstation/Leash/LeashSystem.cs +++ b/Content.Shared/Floofstation/Leash/LeashSystem.cs @@ -1,6 +1,7 @@ using System.Linq; using Content.Shared.Clothing.Components; using Content.Shared.DoAfter; +using Content.Shared.Examine; using Content.Shared.Floofstation.Leash.Components; using Content.Shared.Hands.Components; using Content.Shared.Input; @@ -50,6 +51,7 @@ public override void Initialize() SubscribeLocalEvent(OnJointRemoved, after: [typeof(SharedJointSystem)]); SubscribeLocalEvent>(OnGetLeashedVerbs); + SubscribeLocalEvent(OnLeashExamined); SubscribeLocalEvent(OnLeashInserted); SubscribeLocalEvent(OnLeashRemoved); SubscribeLocalEvent>(OnGetLeashVerbs); @@ -185,7 +187,7 @@ private void OnGetLeashedVerbs(Entity ent, ref GetVerbsEvent ent, ref GetVerbsEvent args) { - if (ent.Comp.LengthConfigs is not { } configurations) + if (!args.CanAccess || !args.CanInteract || ent.Comp.LengthConfigs is not { } configurations) return; // Add a menu listing each length configuration @@ -229,6 +231,12 @@ private void OnJointRemoved(Entity ent, ref JointRemovedEvent }); } + private void OnLeashExamined(Entity ent, ref ExaminedEvent args) + { + var length = ent.Comp.Length; + args.PushMarkup(Loc.GetString("leash-length-examine-text", ("length", length))); + } + private void OnLeashInserted(Entity ent, ref EntGotInsertedIntoContainerMessage args) { if (!_net.IsClient) @@ -261,7 +269,8 @@ private void OnDetachDoAfter(Entity ent, ref LeashDetachDoAfte private bool OnRequestPullLeash(ICommonSession? session, EntityCoordinates targetCoords, EntityUid uid) { - if (session?.AttachedEntity is not { } player + if (_net.IsClient + || session?.AttachedEntity is not { } player || !player.IsValid() || !TryComp(player, out var hands) || hands.ActiveHandEntity is not {} leash @@ -373,14 +382,6 @@ public bool TryLeash(Entity anchor, Entity if (!CanLeash(anchor, leash) || !TryGetLeashTarget(anchor!, out var leashTarget)) return false; - // We reuse pulling attempt here because eugh it already exists - var attempt = new PullAttemptEvent(leash, anchor); - RaiseLocalEvent(anchor, attempt); - RaiseLocalEvent(leash, attempt); - - if (attempt.Cancelled) - return false; - var doAfter = new DoAfterArgs(EntityManager, user, leash.Comp.AttachDelay, new LeashAttachDoAfterEvent(), anchor, leashTarget, leash) { BreakOnDamage = true, @@ -509,6 +510,7 @@ public void SetLeashLength(Entity leash, float length) { leash.Comp.Length = length; RefreshJoints(leash); + _popups.PopupPredicted(Loc.GetString("leash-set-length-popup", ("length", length)), leash.Owner, null); } /// diff --git a/Content.Shared/Footprint/FootPrintsComponent.cs b/Content.Shared/Footprint/FootPrintsComponent.cs index 99aa2106cf..506011499c 100644 --- a/Content.Shared/Footprint/FootPrintsComponent.cs +++ b/Content.Shared/Footprint/FootPrintsComponent.cs @@ -6,6 +6,7 @@ namespace Content.Shared.FootPrint; +// Floof: this system has been effectively rewriteen. DO NOT MERGE UPSTREAM CHANGES. [RegisterComponent] public sealed partial class FootPrintsComponent : Component { diff --git a/Content.Shared/Footprint/PuddleFootPrintsComponent.cs b/Content.Shared/Footprint/PuddleFootPrintsComponent.cs index bea2b6b7a1..52307e7689 100644 --- a/Content.Shared/Footprint/PuddleFootPrintsComponent.cs +++ b/Content.Shared/Footprint/PuddleFootPrintsComponent.cs @@ -3,6 +3,7 @@ namespace Content.Shared.FootPrint; +// Floof: this system has been effectively rewriteen. DO NOT MERGE UPSTREAM CHANGES. [RegisterComponent] public sealed partial class PuddleFootPrintsComponent : Component { diff --git a/Content.Shared/Standing/StandingStateSystem.cs b/Content.Shared/Standing/StandingStateSystem.cs index 562d9fe82b..a5569eb9a5 100644 --- a/Content.Shared/Standing/StandingStateSystem.cs +++ b/Content.Shared/Standing/StandingStateSystem.cs @@ -154,7 +154,7 @@ private void Climb(EntityUid uid) var entityDistances = new Dictionary(); - foreach (var entity in _lookup.GetEntitiesInRange(uid, 0.3f)) + foreach (var entity in _lookup.GetEntitiesIntersecting(uid)) // Floof - changed to GetEntitiesIntersecting to avoid climbing through walls if (HasComp(entity)) entityDistances[entity] = (Transform(uid).Coordinates.Position - Transform(entity).Coordinates.Position).LengthSquared(); diff --git a/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs b/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs index 60eafce474..14e0c7452f 100644 --- a/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs +++ b/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs @@ -144,6 +144,16 @@ private void CanCancelWelderUse(Entity entity, EntityUid user, } } + // Floof - for some reason, wizden impl lacked this. + private void OnWelderUseAttempt(Entity entity, ref ToolUseAttemptEvent args) + { + if (ItemToggle.IsActivated(entity.Owner)) + return; + + _popup.PopupPredicted(Loc.GetString("welder-component-welder-not-lit-message"), entity, args.User); + args.Cancel(); + } + private void OnWelderDoAfter(Entity ent, ref ToolDoAfterEvent args) { if (args.Cancelled) diff --git a/Resources/Locale/en-US/floofstation/leash/leash.ftl b/Resources/Locale/en-US/floofstation/leash/leash.ftl index 4d1a0a7f50..9456107942 100644 --- a/Resources/Locale/en-US/floofstation/leash/leash.ftl +++ b/Resources/Locale/en-US/floofstation/leash/leash.ftl @@ -18,3 +18,6 @@ leash-detaching-popup-others = {THE($user)} is trying to remove the leash {$isSe }... leash-snap-popup = {THE($leash)} snaps off! +leash-set-length-popup = Length set to {$length}m. + +leash-length-examine-text = Its current length is {$length}m. diff --git a/Resources/Prototypes/Entities/Objects/Decoration/ashtray.yml b/Resources/Prototypes/Entities/Objects/Decoration/ashtray.yml index 61554d0621..ad5f6efca8 100644 --- a/Resources/Prototypes/Entities/Objects/Decoration/ashtray.yml +++ b/Resources/Prototypes/Entities/Objects/Decoration/ashtray.yml @@ -1,6 +1,6 @@ - type: entity id: Ashtray - parent: BaseItem + parent: BaseStorageItem # Floof - reparented name: ashtray description: Proven by scientists to improve the smoking experience by 37%! components: @@ -22,9 +22,6 @@ maxItemSize: Tiny grid: - 0,0,9,0 - - type: ContainerContainer - containers: - storagebase: !type:Container - type: StorageFillVisualizer fillBaseName: icon maxFillLevels: 10 diff --git a/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml b/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml index 2a546bc5cf..3674bf2f6c 100644 --- a/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml +++ b/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml @@ -54,6 +54,7 @@ - type: Construction graph: Table node: TableFrame + - type: Climbable # Floof - making table frames climbable - type: entity id: CounterWoodFrame @@ -109,6 +110,7 @@ - type: Construction graph: Table node: CounterWoodFrame + - type: Climbable # Floof - making table frames climbable - type: entity id: CounterMetalFrame