]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix goliath tentacle exploit (#37168)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Thu, 15 May 2025 03:55:04 +0000 (23:55 -0400)
committerGitHub <noreply@github.com>
Thu, 15 May 2025 03:55:04 +0000 (20:55 -0700)
Content.Shared/Stunnable/SharedStunSystem.cs
Resources/Prototypes/Entities/Mobs/NPCs/asteroid.yml

index 1866ad39ef4a5c59728c89cb52808afb5de2ea92..acfc554fb128fab983996f8839aa049db2e04d27 100644 (file)
@@ -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<StunOnContactComponent> ent, ref ComponentStartup args)
     {
-        if (TryComp<PhysicsComponent>(ent, out var body))
-            _broadphase.RegenerateContacts((ent, body));
+        if (!TryComp<PhysicsComponent>(ent, out var body) ||
+            !TryComp<FixturesComponent>(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<StunOnContactComponent> ent, ref StartCollideEvent args)
index c4c131a7ab21aca9ef5494b55eedd8c4e9c360d5..a67db1e2933affb6d08e74b3a87ffa3448238662 100644 (file)
   id: GoliathTentacle
   name: tentacle
   components:
-  - type: Transform
-    anchored: True
   - type: Physics
-    bodyType: Static
+    bodyType: Dynamic
     canCollide: true
   - type: InteractionOutline
   - type: Sprite