Skip to content

Commit

Permalink
Actually make the defaults sane which I forgor in the last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nikthechampiongr committed Mar 25, 2024
1 parent d722f83 commit 7afce78
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Content.Server/Implants/SubdermalImplantSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void OnScramImplant(EntityUid uid, SubdermalImplantComponent component,

var grids = _lookupSystem.GetEntitiesInRange<MapGridComponent>(entityCoords, implant.TeleportRadius).ToList();
_random.Shuffle(grids);
var targetCoords = entityCoords; // If we somehow fail to find a suitable tile then we essentially we just don't teleport.
MapCoordinates? targetCoords = null;

foreach (var grid in grids)
{
Expand Down Expand Up @@ -161,11 +161,13 @@ private void OnScramImplant(EntityUid uid, SubdermalImplantComponent component,
break;
}

_xform.SetWorldPosition(ent, targetCoords.Position);
_xform.AttachToGridOrMap(ent, xform);
_audio.PlayPvs(implant.TeleportSound, ent);

args.Handled = true;
if (targetCoords != null)
{
_xform.SetWorldPosition(ent, targetCoords.Value.Position);
_xform.AttachToGridOrMap(ent, xform);
_audio.PlayPvs(implant.TeleportSound, ent);
args.Handled = true;
}
}

private void OnDnaScramblerImplant(EntityUid uid, SubdermalImplantComponent component, UseDnaScramblerImplantEvent args)
Expand Down

0 comments on commit 7afce78

Please sign in to comment.