public static void ResetRouting(Sim sim) { if (sim == null) { return; } SimRoutingComponent component = sim.SimRoutingComponent; if (component != null) { if (component.LockedDoorsDuringPlan != null && component.LockedDoorsDuringPlan.Count > 0) { foreach (Door door in component.LockedDoorsDuringPlan) { if (door == null) { continue; } PortalComponent portalComponent = door.PortalComponent; if (portalComponent != null) { portalComponent.FreeAllRoutingLanes(); } door.SetObjectToReset(); } } component.LockedDoorsDuringPlan = new List <Door>(); } }
protected override bool PrivatePerform(Door obj) { PortalComponent portalComponent = obj.PortalComponent; if (portalComponent != null) { portalComponent.FreeAllRoutingLanes(); } obj.SetObjectToReset(); return(true); }