Добавлена проверка на валидность EntityUid в DontSellingGridSystems для предотвращения обработки недействительных объектов.
This commit is contained in:
parent
103e1c73ad
commit
72c4842213
1 changed files with 5 additions and 1 deletions
|
|
@ -72,6 +72,9 @@ public sealed class StationDontSellingSystems : EntitySystem
|
|||
|
||||
private void DepreciatePrice(EntityUid uid)
|
||||
{
|
||||
if (!uid.IsValid())
|
||||
return;
|
||||
|
||||
EnsureComp<DontSellComponent>(uid);
|
||||
|
||||
if (!_containerQuery.TryComp(uid, out var containers))
|
||||
|
|
@ -81,7 +84,8 @@ public sealed class StationDontSellingSystems : EntitySystem
|
|||
{
|
||||
foreach (var ent in container.ContainedEntities)
|
||||
{
|
||||
DepreciatePrice(ent);
|
||||
if (ent.IsValid())
|
||||
DepreciatePrice(ent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue