Skip to content

Commit

Permalink
Fix cryo teleport (#1482)
Browse files Browse the repository at this point in the history
* check station

* better
  • Loading branch information
MiraHell authored Jul 29, 2024
1 parent b65011c commit f1967c1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public bool TeleportEntityToCryoStorage(EntityUid target)
var cryostorageComponents = EntityQueryEnumerator<CryostorageComponent>();
while (cryostorageComponents.MoveNext(out var cryostorageUid, out var сryostorageComp))
{
if (TryTeleportToCryo(target, cryostorageUid, сryostorageComp.TeleportPortralID))
if (TryTeleportToCryo(target, cryostorageUid, station.Value, сryostorageComp.TeleportPortralID))
return true;
}

Expand All @@ -136,8 +136,11 @@ private bool TargetAlreadyInCryo(EntityUid target)
return EntityQuery<CryostorageComponent>().Any(comp => comp.StoredPlayers.Contains(target));
}

private bool TryTeleportToCryo(EntityUid target, EntityUid cryopodUid, string teleportPortralID)
private bool TryTeleportToCryo(EntityUid target, EntityUid cryopodUid, EntityUid station, string teleportPortralID)
{
if (station != _station.GetOwningStation(cryopodUid))
return false;

var portal = Spawn(teleportPortralID, Transform(target).Coordinates);

if (TryComp<AmbientSoundComponent>(portal, out var ambientSoundComponent))
Expand Down

0 comments on commit f1967c1

Please sign in to comment.