public static void RemoveUnloadedObjectIDs(EquipmentGroup group) { if (group.IDOverride != null) { for (int i = 0; i < group.IDOverride.Count; i++) { if (!IM.OD.ContainsKey(group.IDOverride[i])) { //If this is a vaulted gun with all it's components loaded, we should still have this in the object list if (LoadedTemplateManager.LoadedVaultFiles.ContainsKey(group.IDOverride[i])) { if (!LoadedTemplateManager.LoadedVaultFiles[group.IDOverride[i]].AllComponentsLoaded()) { TNHTweakerLogger.LogWarning("TNHTweaker -- Vaulted gun in table does not have all components loaded, removing it! VaultID : " + group.IDOverride[i]); group.IDOverride.RemoveAt(i); i -= 1; } } //If this was not a vaulted gun, remove it else { TNHTweakerLogger.LogWarning("TNHTweaker -- Object in table not loaded, removing it from object table! ObjectID : " + group.IDOverride[i]); group.IDOverride.RemoveAt(i); i -= 1; } } } } }
public static void RemoveUnloadedObjectIDs(SosigTemplate template) { //Loop through all outfit configs and remove any clothing objects that don't exist foreach (OutfitConfig config in template.OutfitConfigs) { for (int i = 0; i < config.Headwear.Count; i++) { if (!IM.OD.ContainsKey(config.Headwear[i])) { TNHTweakerLogger.LogWarning("TNHTweaker -- Clothing item not loaded, removing it from clothing config! ObjectID : " + config.Headwear[i]); config.Headwear.RemoveAt(i); i -= 1; } } if (config.Headwear.Count == 0) { config.Chance_Headwear = 0; } for (int i = 0; i < config.Facewear.Count; i++) { if (!IM.OD.ContainsKey(config.Facewear[i])) { TNHTweakerLogger.LogWarning("TNHTweaker -- Clothing item not loaded, removing it from clothing config! ObjectID : " + config.Facewear[i]); config.Facewear.RemoveAt(i); i -= 1; } } if (config.Facewear.Count == 0) { config.Chance_Facewear = 0; } for (int i = 0; i < config.Eyewear.Count; i++) { if (!IM.OD.ContainsKey(config.Eyewear[i])) { TNHTweakerLogger.LogWarning("TNHTweaker -- Clothing item not loaded, removing it from clothing config! ObjectID : " + config.Eyewear[i]); config.Eyewear.RemoveAt(i); i -= 1; } } if (config.Eyewear.Count == 0) { config.Chance_Eyewear = 0; } for (int i = 0; i < config.Torsowear.Count; i++) { if (!IM.OD.ContainsKey(config.Torsowear[i])) { TNHTweakerLogger.LogWarning("TNHTweaker -- Clothing item not loaded, removing it from clothing config! ObjectID : " + config.Torsowear[i]); config.Torsowear.RemoveAt(i); i -= 1; } } if (config.Torsowear.Count == 0) { config.Chance_Torsowear = 0; } for (int i = 0; i < config.Pantswear.Count; i++) { if (!IM.OD.ContainsKey(config.Pantswear[i])) { TNHTweakerLogger.LogWarning("TNHTweaker -- Clothing item not loaded, removing it from clothing config! ObjectID : " + config.Pantswear[i]); config.Pantswear.RemoveAt(i); i -= 1; } } if (config.Pantswear.Count == 0) { config.Chance_Pantswear = 0; } for (int i = 0; i < config.Pantswear_Lower.Count; i++) { if (!IM.OD.ContainsKey(config.Pantswear_Lower[i])) { TNHTweakerLogger.LogWarning("TNHTweaker -- Clothing item not loaded, removing it from clothing config! ObjectID : " + config.Pantswear_Lower[i]); config.Pantswear_Lower.RemoveAt(i); i -= 1; } } if (config.Pantswear_Lower.Count == 0) { config.Chance_Pantswear_Lower = 0; } for (int i = 0; i < config.Backpacks.Count; i++) { if (!IM.OD.ContainsKey(config.Backpacks[i])) { TNHTweakerLogger.LogWarning("TNHTweaker -- Clothing item not loaded, removing it from clothing config! ObjectID : " + config.Backpacks[i]); config.Backpacks.RemoveAt(i); i -= 1; } } if (config.Backpacks.Count == 0) { config.Chance_Backpacks = 0; } } }