Even more engine changes

This commit is contained in:
ElectroJr
2024-12-24 21:00:53 +13:00
parent a8cc0397c2
commit b555a6049e
7 changed files with 26 additions and 11 deletions

View File

@@ -75,7 +75,10 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
var enumerator = AllEntityQuery<NetworkConfiguratorComponent>();
while (enumerator.MoveNext(out var uid, out var conf))
{
if (CompOrNull<TransformComponent>(conf.ActiveDeviceList)?.MapUid != ev.Map)
if (!TryComp(conf.ActiveDeviceList, out TransformComponent? listXform))
continue;
if (!ev.MapIds.Contains(listXform.MapID))
continue;
// The linked device list is (probably) being saved. Make sure that the configurator is also being saved
@@ -83,9 +86,10 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
// containing a set of all entities that are about to be saved, which would make checking this much easier.
// This is a shitty bandaid, and will force close the UI during auto-saves.
// TODO Map serialization refactor
// I'm refactoring it now and I still dont know what to do
var xform = Transform(uid);
if (xform.MapUid == ev.Map && IsSaveable(uid))
if (ev.MapIds.Contains(xform.MapID) && IsSaveable(uid))
continue;
_uiSystem.CloseUi(uid, NetworkConfiguratorUiKey.Configure);