Skip to content

Commit

Permalink
более надежный метод взятия трансформа
Browse files Browse the repository at this point in the history
Signed-off-by: JDtrimble <[email protected]>
  • Loading branch information
pxc1984 committed Jul 29, 2024
1 parent e7cffed commit d99f822
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Content.Server/_Sunrise/Smile/SmileSlimeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ private void OnLoveAction(EntityUid smileUid, SmileSlimeComponent comp, SmileLov
CancelDuplicate = true,
};

var targetXform = Transform(args.Target);
if (!TryComp<TransformComponent>(args.Target, out var targetXform))
return;

_audio.PlayPvs(comp.SoundSpecifier, targetXform.Coordinates);
_entMan.SpawnEntity("EffectHearts", targetXform.Coordinates);
_popupSystem.PopupEntity(
Expand All @@ -98,7 +100,9 @@ private void OnDoAfter(EntityUid uid, SmileSlimeComponent comp, SmileLoveDoAfter
if (args.Target == null)
return;

var targetXform = Transform(args.Target.Value);
if (!TryComp<TransformComponent>(args.Target.Value, out var targetXform))
return;

_entMan.SpawnEntity("EffectHearts", targetXform.Coordinates);
_audio.PlayPvs(comp.SoundSpecifier, targetXform.Coordinates);
_damageableSystem.TryChangeDamage(args.Target, comp.DamageSpecifier, true, false);
Expand Down

0 comments on commit d99f822

Please sign in to comment.