/// <summary>
        /// Replaces a nuclear battery modules with Depleted Reactor Rods when they fully drained.
        /// </summary>
        /// <param name="modules">The equipment modules.</param>
        /// <param name="slotName">Th slot name.</param>
        /// <param name="nuclearBattery">The nuclear battery that just ran out.</param>
        private void DepleteNuclearBattery(Equipment modules, string slotName, Battery nuclearBattery)
        {
            // Drained nuclear batteries are handled just like how the Nuclear Reactor handles depleated reactor rods
            InventoryItem inventoryItem = modules.RemoveItem(slotName, true, false);

            Object.Destroy(inventoryItem.item.gameObject);
            modules.AddItem(slotName, CyclopsModule.SpawnCyclopsModule(CyclopsModule.DepletedNuclearModuleID), true);
            ErrorMessage.AddMessage("Nuclear Reactor Module depleted");
        }
        public void OnProtoDeserializeObjectTree(ProtobufSerializer serializer)
        {
            bool hasSaveData = this.SaveData.Load();

            if (hasSaveData)
            {
                // Because the items here aren't being serialized with everything else normally,
                // I've used custom save data to handle whatever gets left in these slots.

                // The following is a recreation of the essential parts of the Equipment.ResponseEquipment method.
                foreach (string slot in SlotHelper.SlotNames)
                {
                    // These slots need to be added before we can add items to them
                    this.Modules.AddSlot(slot);

                    EmModuleSaveData savedModule = SaveData.GetModuleInSlot(slot);

                    if (savedModule.ItemID == (int)TechType.None)
                    {
                        continue;
                    }

                    InventoryItem spanwedItem = CyclopsModule.SpawnCyclopsModule((TechType)savedModule.ItemID);

                    if (spanwedItem is null)
                    {
                        continue;
                    }

                    if (savedModule.BatteryCharge > 0f) // Modules without batteries are stored with a -1 value for charge
                    {
                        spanwedItem.item.GetComponent <Battery>().charge = savedModule.BatteryCharge;
                    }

                    this.Modules.AddItem(slot, spanwedItem, true);
                }
            }
            else
            {
                this.UnlockDefaultModuleSlots();
            }
        }