Stop restoring Unity facade docking graph
This commit is contained in:
parent
25736359ca
commit
26f0392a23
2 changed files with 7 additions and 54 deletions
|
|
@ -7756,7 +7756,6 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
"ZoneRenderer?.ApplyDaemonFrame(daemonZone, run)",
|
||||
"ApplyDaemonEntitySnapshotsInPlace",
|
||||
"ReplaceZoneEntitiesFromTypedSnapshots",
|
||||
"RestoreChildAndDockingRelationships",
|
||||
"RestoreCurrentEntityBinding",
|
||||
"RestoreCurrentEntityBinding(currentEntity, actionBarBindings)",
|
||||
"RestoreActiveConsumablesFromTypedEntitySnapshot(entity, entitySnapshot)",
|
||||
|
|
@ -7841,7 +7840,12 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
"entity.VisibleFriendlies.Add(target)",
|
||||
"currentEntity.Parent.DockingBays",
|
||||
"currentEntity.Parent is OrbitalEntity",
|
||||
"DoDock(currentEntity.Parent, dockingBay)"
|
||||
"DoDock(currentEntity.Parent, dockingBay)",
|
||||
"RestoreChildAndDockingRelationships",
|
||||
"child.SetParent(parent)",
|
||||
"ship.SetParent(parent)",
|
||||
"dockingBay.DockedShip = ship",
|
||||
"Zone.Entities.Contains(ship)"
|
||||
};
|
||||
|
||||
var forbiddenGameplayHits = forbiddenGameplaySymbols
|
||||
|
|
@ -8131,8 +8135,7 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
|
||||
var permittedEntityProjectionMethods = new[]
|
||||
{
|
||||
"ReplaceZoneEntitiesFromTypedSnapshots",
|
||||
"RestoreChildAndDockingRelationships"
|
||||
"ReplaceZoneEntitiesFromTypedSnapshots"
|
||||
};
|
||||
var unauthorizedEntityProjectionHits = FindMethodScopedLineHits(
|
||||
actionGameManager,
|
||||
|
|
|
|||
|
|
@ -2757,8 +2757,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
restoredEntities[entitySnapshot.RecordKey] = entity;
|
||||
}
|
||||
|
||||
RestoreChildAndDockingRelationships(entitySnapshots, restoredEntities);
|
||||
|
||||
foreach (var entitySnapshot in entitySnapshots)
|
||||
{
|
||||
if (!restoredEntities.TryGetValue(entitySnapshot.RecordKey, out var entity))
|
||||
|
|
@ -2790,54 +2788,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
private void RestoreChildAndDockingRelationships(
|
||||
IReadOnlyList<AetheriaRuntimeEntitySnapshot> entitySnapshots,
|
||||
IReadOnlyDictionary<string, Entity> restoredEntities)
|
||||
{
|
||||
foreach (var entitySnapshot in entitySnapshots)
|
||||
{
|
||||
if (!restoredEntities.TryGetValue(entitySnapshot.RecordKey, out var parent))
|
||||
continue;
|
||||
|
||||
foreach (var childKey in entitySnapshot.ChildEntityKeys)
|
||||
{
|
||||
if (!restoredEntities.TryGetValue(childKey, out var child) ||
|
||||
child == parent ||
|
||||
child.Parent == parent)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
child.RemoveParent();
|
||||
child.SetParent(parent);
|
||||
}
|
||||
|
||||
for (var bayIndex = 0; bayIndex < entitySnapshot.DockingBayAssignments.Count; bayIndex++)
|
||||
{
|
||||
var childIndex = entitySnapshot.DockingBayAssignments[bayIndex];
|
||||
if (childIndex < 0 ||
|
||||
childIndex >= entitySnapshot.ChildEntityKeys.Count ||
|
||||
bayIndex >= parent.DockingBays.Count ||
|
||||
!restoredEntities.TryGetValue(entitySnapshot.ChildEntityKeys[childIndex], out var child) ||
|
||||
!(child is Ship ship))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var dockingBay = parent.DockingBays[bayIndex];
|
||||
dockingBay.DockedShip = ship;
|
||||
if (ship.Parent != parent)
|
||||
{
|
||||
ship.RemoveParent();
|
||||
ship.SetParent(parent);
|
||||
}
|
||||
if (Zone.Entities.Contains(ship))
|
||||
Zone.Entities.Remove(ship);
|
||||
ship.RestoreActiveState(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RestoreCurrentEntityBinding(
|
||||
Entity currentEntity,
|
||||
IReadOnlyList<AetheriaRuntimeActionBarBindingSnapshot> actionBarBindings)
|
||||
|
|
|
|||
Loading…
Reference in a new issue