From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Thu, 15 May 2025 03:55:04 +0000 (-0400) Subject: Fix goliath tentacle exploit (#37168) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=6fbd0c9da1c10699322316528bdae1ef37bafa55;p=space-station-14.git Fix goliath tentacle exploit (#37168) --- diff --git a/Content.Shared/Stunnable/SharedStunSystem.cs b/Content.Shared/Stunnable/SharedStunSystem.cs index 1866ad39ef..acfc554fb1 100644 --- a/Content.Shared/Stunnable/SharedStunSystem.cs +++ b/Content.Shared/Stunnable/SharedStunSystem.cs @@ -17,6 +17,7 @@ using Content.Shared.StatusEffect; using Content.Shared.Throwing; using Content.Shared.Whitelist; using Robust.Shared.Audio.Systems; +using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Events; using Robust.Shared.Physics.Systems; @@ -31,6 +32,7 @@ public abstract class SharedStunSystem : EntitySystem [Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly EntityWhitelistSystem _entityWhitelist = default!; + [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly StandingStateSystem _standingState = default!; [Dependency] private readonly StatusEffectsSystem _statusEffect = default!; @@ -116,8 +118,13 @@ public abstract class SharedStunSystem : EntitySystem private void OnStunOnContactStartup(Entity ent, ref ComponentStartup args) { - if (TryComp(ent, out var body)) - _broadphase.RegenerateContacts((ent, body)); + if (!TryComp(ent, out var body) || + !TryComp(ent, out var manager)) + return; + + _physics.SetBodyType(ent, BodyType.Dynamic, manager: manager, body: body); + _physics.SetCanCollide(ent, true, manager: manager, body: body); + _broadphase.RegenerateContacts((ent, body)); } private void OnStunOnContactCollide(Entity ent, ref StartCollideEvent args) diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/asteroid.yml b/Resources/Prototypes/Entities/Mobs/NPCs/asteroid.yml index c4c131a7ab..a67db1e293 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/asteroid.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/asteroid.yml @@ -121,10 +121,8 @@ id: GoliathTentacle name: tentacle components: - - type: Transform - anchored: True - type: Physics - bodyType: Static + bodyType: Dynamic canCollide: true - type: InteractionOutline - type: Sprite