mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Fix PVS exception (#5196)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Robust.Server.GameStates;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Robust.Server.GameObjects;
|
||||
|
||||
@@ -23,6 +24,8 @@ public sealed class UserInterfaceSystem : SharedUserInterfaceSystem
|
||||
|
||||
foreach (var ui in buis)
|
||||
{
|
||||
DebugTools.Assert(ent.Comp.OpenInterfaces[ui].Count > 0);
|
||||
DebugTools.Assert(HasComp<UserInterfaceComponent>(ui));
|
||||
args.Entities.Add(ui);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,13 @@ internal sealed partial class PvsSystem
|
||||
/// </summary>
|
||||
private bool RecursivelyAddOverride(PvsSession session, EntityUid uid, GameTick fromTick, bool addChildren)
|
||||
{
|
||||
var xform = _xformQuery.GetComponent(uid);
|
||||
if (!_xformQuery.TryGetComponent(uid, out var xform))
|
||||
{
|
||||
// Can happen if systems add deleted entities to PVS move event.
|
||||
Log.Error($"Attempted to add non-existent entity {uid} to PVS override for session {session.Session}");
|
||||
return false;
|
||||
}
|
||||
|
||||
var parent = xform.ParentUid;
|
||||
|
||||
// First we process all parents. This is because while this entity may already have been added
|
||||
|
||||
Reference in New Issue
Block a user