public void RemoveItselfAsManager() { foreach (String resourcename in resources_to_supply) { ORSResourceManager resource_manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); if (resource_manager != null && resource_manager.PartModule == this) { resource_manager.updatePartModule(null); } } }
public override void OnFixedUpdate() { if (resources_to_supply == null) { return; } foreach (String resourcename in resources_to_supply) { ORSResourceManager resource_manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); if (resource_manager == null) { resource_manager = createResourceManagerForResource(resourcename); print("[ORS] Creating Resource Manager for Vessel " + vessel.GetName() + " (" + resourcename + ")"); } if (resource_manager.PartModule == null || resource_manager.PartModule.vessel != this.vessel || resource_manager.IsUpdatedAtLeastOnce == false) { resource_manager.updatePartModule(this); print("[ORS] Updated PartModule of Manager for " + resourcename + " to " + this.part.partInfo.title); } if (resource_manager.PartModule == this) { resource_manager.update(); } } var priority_manager = getSupplyPriorityManager(this.vessel); if (priority_manager.processingPart == null || priority_manager.processingPart.vessel != this.vessel) { priority_manager.processingPart = this; } if (priority_manager.processingPart == this) { priority_manager.UpdateResourceSuppliables(TimeWarp.fixedDeltaTime); } }