Fix typing, Importer needs type to be defaultBuilds as buildtype can be a string

This commit is contained in:
CWX
2025-01-16 18:28:10 +00:00
parent c6538a7607
commit 9fa39a972d
7 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -522,7 +522,7 @@ public class BotWeaponGenerator
{
var id = _hashUtil.Generate();
_botGeneratorHelper.AddItemWithChildrenToEquipmentSlot(
new() { EquipmentSlots.SecuredContainer.ToString() },
new() { EquipmentSlots.SecuredContainer },
id,
ammoTemplate,
new()
+4 -4
View File
@@ -139,9 +139,9 @@ public class PlayerScavGenerator
// Add additional items to player scav as loot
AddAdditionalLootToPlayerScavContainers(playerScavKarmaSettings.LootItemsToAddChancePercent, scavData, [
"TacticalVest",
"Pockets",
"Backpack"
EquipmentSlots.TacticalVest,
EquipmentSlots.Pockets,
EquipmentSlots.Backpack
]);
// Remove secure container
@@ -162,7 +162,7 @@ public class PlayerScavGenerator
/// <param name="possibleItemsToAdd">dict of tpl + % chance to be added</param>
/// <param name="scavData"></param>
/// <param name="containersToAddTo">Possible slotIds to add loot to</param>
protected void AddAdditionalLootToPlayerScavContainers(Dictionary<string, double> possibleItemsToAdd, BotBase scavData, List<string> containersToAddTo)
protected void AddAdditionalLootToPlayerScavContainers(Dictionary<string, double> possibleItemsToAdd, BotBase scavData, List<EquipmentSlots> containersToAddTo)
{
foreach (var tpl in possibleItemsToAdd)
{
@@ -66,7 +66,7 @@ public class ExternalInventoryMagGen : InventoryMagGen, IInventoryMagGen
);
var fitsIntoInventory = _botGeneratorHelper.AddItemWithChildrenToEquipmentSlot(
[EquipmentSlots.TacticalVest.ToString(), EquipmentSlots.Pockets.ToString()],
[EquipmentSlots.TacticalVest, EquipmentSlots.Pockets],
magazineWithAmmo[0].Id,
magazineTpl,
magazineWithAmmo,
@@ -37,7 +37,7 @@ public class UbglExternalMagGen : InventoryMagGen, IInventoryMagGen
inventoryMagGen.GetAmmoTemplate().Id,
(int)bulletCount,
inventoryMagGen.GetPmcInventory(),
[EquipmentSlots.TacticalVest.ToString()]
[EquipmentSlots.TacticalVest]
);
}
}
+2 -2
View File
@@ -129,11 +129,11 @@ public class BotWeaponGeneratorHelper
string ammoTpl,
int cartridgeCount,
BotBaseInventory inventory,
List<string> equipmentSlotsToAddTo
List<EquipmentSlots> equipmentSlotsToAddTo
)
{
if (equipmentSlotsToAddTo is null)
equipmentSlotsToAddTo = [EquipmentSlots.TacticalVest.ToString(), EquipmentSlots.Pockets.ToString()];
equipmentSlotsToAddTo = [EquipmentSlots.TacticalVest, EquipmentSlots.Pockets];
var ammoItems = _itemHelper.SplitStack(new () {
Id = _hashUtil.Generate(),
+1 -1
View File
@@ -163,7 +163,7 @@ public class MagazineTemplateAmmoItem
}
/** Used by defaultEquipmentPresets.json */
public class DefaultEquipmentPreset : UserBuild
public class DefaultEquipmentPreset : EquipmentBuild
{
[JsonPropertyName("Items")]
public List<Item>? Items { get; set; }
+2 -2
View File
@@ -40,7 +40,7 @@ public class Templates
/** Default equipment loadouts that show on main inventory screen */
[JsonPropertyName("defaultEquipmentPresets")]
public List<EquipmentBuild>? DefaultEquipmentPresets { get; set; }
public List<DefaultEquipmentPreset>? DefaultEquipmentPresets { get; set; }
/** Achievements */
[JsonPropertyName("achievements")]
@@ -49,4 +49,4 @@ public class Templates
/** Location services data */
[JsonPropertyName("locationServices")]
public LocationServices? LocationServices { get; set; }
}
}