Hotfix: Not all pens embed, exploding pens embed when activated (#41105)

* Revert "All pens embed (#39104)"

This reverts commit 3c1982a85f.

* only activated pens embed

* fix disembedding during prediction
This commit is contained in:
slarticodefast
2025-10-26 02:37:41 +02:00
committed by GitHub
parent 27af3ab934
commit bb248dcff8
4 changed files with 35 additions and 40 deletions

View File

@@ -1,18 +1,15 @@
using System.Numerics;
using Content.Shared.CombatMode.Pacification;
using Content.Shared.Damage;
using Content.Shared.DoAfter;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Inventory;
using Content.Shared.Mobs.Components;
using Content.Shared.Throwing;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Dynamics;
using Robust.Shared.Physics.Events;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Serialization;
@@ -24,7 +21,6 @@ public abstract partial class SharedProjectileSystem : EntitySystem
{
public const string ProjectileFixture = "projectile";
[Dependency] private readonly INetManager _net = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
@@ -136,8 +132,9 @@ public abstract partial class SharedProjectileSystem : EntitySystem
if (!Resolve(uid, ref component))
return;
if (component.EmbeddedIntoUid is not null)
{
if (component.EmbeddedIntoUid == null)
return; // the entity is not embedded, so do nothing
if (TryComp<EmbeddedContainerComponent>(component.EmbeddedIntoUid.Value, out var embeddedContainer))
{
embeddedContainer.EmbeddedObjects.Remove(uid);
@@ -145,11 +142,10 @@ public abstract partial class SharedProjectileSystem : EntitySystem
if (embeddedContainer.EmbeddedObjects.Count == 0)
RemCompDeferred<EmbeddedContainerComponent>(component.EmbeddedIntoUid.Value);
}
}
if (component.DeleteOnRemove && _net.IsServer)
if (component.DeleteOnRemove)
{
QueueDel(uid);
PredictedQueueDel(uid);
return;
}

View File

@@ -3721,13 +3721,6 @@
id: 9121
time: '2025-10-18T17:58:32.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/38871
- author: Mehnix
changes:
- message: All pens now embed when thrown.
type: Tweak
id: 9122
time: '2025-10-18T21:39:32.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/39104
- author: JackRyd3r
changes:
- message: You can now put the Energy Magnum to into jackboots/combat boots and

View File

@@ -26,16 +26,6 @@
maxDistance: 2
- type: UseDelay
delay: 1.5
- type: EmbeddableProjectile
offset: 0.3,0.0
removalTime: 0.0
- type: ThrowingAngle
angle: 315
- type: LandAtCursor
- type: DamageOtherOnHit
damage:
types:
Piercing: 1
- type: Fixtures
fixtures:
fix1:
@@ -53,19 +43,25 @@
- type: entity
parent: Pen
id: BasePenFancy
id: PenEmbeddable
abstract: true
components:
- type: EmbeddableProjectile
offset: 0.3,0.0
removalTime: 0.0
- type: ThrowingAngle
angle: 315
- type: LandAtCursor
- type: DamageOtherOnHit
damage:
types:
Piercing: 3 #nothing shows luxury like inflicting injury
Piercing: 3
#TODO: I want the luxury pen to write a cool font like Merriweather in the future.
- type: entity
name: luxury pen
parent: BasePenFancy
parent: Pen
id: LuxuryPen
description: A fancy and expensive pen that you only deserve to own if you're qualified to handle vast amounts of paperwork.
components:
@@ -76,7 +72,7 @@
- type: entity
id: BaseAdvancedPen
parent: BasePenFancy
parent: PenEmbeddable
abstract: true
components:
- type: Tag
@@ -124,7 +120,7 @@
- type: entity
name: captain's fountain pen
parent: BasePenFancy
parent: PenEmbeddable
id: PenCap
description: A luxurious fountain pen for the captain of the station.
components:
@@ -133,7 +129,7 @@
- type: entity
name: hop's fountain pen
parent: BasePenFancy
parent: PenEmbeddable
id: PenHop
description: A luxurious fountain pen for the hop of the station.
components:
@@ -142,7 +138,7 @@
- type: entity
name: wizard's magical pen
parent: [ BasePenFancy, BaseMagicalContraband ]
parent: [ PenEmbeddable, BaseMagicalContraband ]
id: PenWiz
description: A luxurious fountain pen. Seems to have a magical crystal eraser.
components:

View File

@@ -1,8 +1,6 @@
- type: entity
name: pen
suffix: Exploding
parent: Pen
description: A dark ink pen.
id: PenExploding
components:
- type: TimerTrigger
@@ -25,6 +23,18 @@
- Trigger
- type: EmitSoundOnUse
handle: false # don't want the sound to stop the explosion from triggering
- type: AddComponentsOnTrigger # make them embed into the target, but only when activated so that they can't be metagamed
components: # copied from PenEmbeddable
- type: EmbeddableProjectile
offset: 0.3,0.0
removalTime: 0.0
- type: ThrowingAngle
angle: 315
- type: LandAtCursor
- type: DamageOtherOnHit
damage:
types:
Piercing: 3
- type: entity
parent: [BaseItem, BaseSyndicateContraband]