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

@@ -131,7 +131,7 @@ public sealed class DeviceListSystem : SharedDeviceListSystem
var enumerator = AllEntityQuery<DeviceListComponent, TransformComponent>();
while (enumerator.MoveNext(out var uid, out var device, out var xform))
{
if (xform.MapUid != ev.Map)
if (!ev.MapIds.Contains(xform.MapID))
continue;
foreach (var ent in device.Devices)
@@ -144,7 +144,10 @@ public sealed class DeviceListSystem : SharedDeviceListSystem
continue;
}
if (linkedXform.MapUid == ev.Map)
// This is assuming that **all** of the map is getting saved.
// Which is not necessarily true.
// AAAAAAAAAAAAAA
if (ev.MapIds.Contains(linkedXform.MapID))
continue;
toRemove.Add(ent);

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);