Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vonsant committed Dec 3, 2024
1 parent a87d122 commit 95efaed
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Content.Server/_CorvaxNext/Storage/AnchorableStorageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
namespace Content.Server._CorvaxNext.Storage;

/// <summary>
/// Используется для ограничения операций якорения хранилищ (не более одной сумки на тайл)
/// и выброса живых содержимых при якорении.
/// This is used for restricting anchor operations on storage (one bag max per tile)
/// and ejecting living contents on anchor.
/// </summary>
public sealed class AnchorableStorageSystem : EntitySystem
{
Expand Down Expand Up @@ -44,7 +44,8 @@ private void OnAnchorStateChanged(EntityUid uid, AnchorableStorageComponent comp
return;
}

// Выбрасываем любые разумные существа внутри хранилища.
// Eject any sapient creatures inside the storage.
// Does not recurse down into bags in bags - player characters are the largest concern, and they'll only fit in duffelbags.
if (!TryComp<StorageComponent>(uid, out var storage))
return;

Expand All @@ -64,7 +65,7 @@ private void OnAnchorAttempt(EntityUid uid, AnchorableStorageComponent comp, ref
if (!TryComp<TransformComponent>(uid, out var xform))
return;

// Если вокруг ничего нет, можем якориться без проблем.
// Nothing around? We can anchor without issue.
if (!CheckOverlap(uid))
return;

Expand All @@ -77,7 +78,7 @@ private void OnInsertAttempt(EntityUid uid, AnchorableStorageComponent comp, ref
if (args.Cancelled)
return;

// Проверяем на наличие живых существ, они не должны вставляться при якорении.
// Check for living things, they should not insert when anchored.
if (!HasComp<MindContainerComponent>(args.EntityUid))
return;

Expand All @@ -102,11 +103,11 @@ public bool CheckOverlap(EntityUid uid)

while (enumerator.MoveNext(out var otherEnt))
{
// Не сравниваем с самим собой.
// Don't match yourself.
if (otherEnt == uid)
continue;

// Если другое хранилище уже закреплено здесь.
// Is another storage entity is already anchored here?
if (HasComp<AnchorableStorageComponent>(otherEnt))
return true;
}
Expand Down

0 comments on commit 95efaed

Please sign in to comment.