Fix some issues with latest 3.10 dumps #2

Closed
DrakiaXYZ wants to merge 1 commits from DrakiaXYZ/BotGenerator:fix-zombies into master
5 changed files with 472203 additions and 423523 deletions
Showing only changes of commit 3ec2ce789b - Show all commits

View File

@ -53,7 +53,14 @@
pmcusec = 51, pmcusec = 51,
skier = 52, skier = 52,
peacemaker = 53, peacemaker = 53,
bosspartisan = 54 bosspartisan = 54,
sectantpredvestnik = 55,
sectantprizrak = 56,
sectantoni = 57,
infectedassault = 58,
infectedpmc = 59,
infectedcivil = 60,
infectedlaborant = 61,
infectedtagilla = 62
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,8 @@ namespace Generator.Helpers.Gear
} }
var template = ItemTemplateHelper.GetTemplateById(inventoryItem._tpl); var template = ItemTemplateHelper.GetTemplateById(inventoryItem._tpl);
var parentTemplate = ItemTemplateHelper.GetTemplateById(baseBot.Inventory.items.Single(i => i._id == inventoryItem.parentId)._tpl); var parentId = baseBot.Inventory.items.SingleOrDefault(i => i._id == inventoryItem.parentId)?._tpl;
var parentTemplate = parentId != null ? ItemTemplateHelper.GetTemplateById(parentId) : null;
if (!(parentTemplate?._props?.Slots?.FirstOrDefault(slot => slot._name == inventoryItem.slotId)?._required ?? false)) if (!(parentTemplate?._props?.Slots?.FirstOrDefault(slot => slot._name == inventoryItem.slotId)?._required ?? false))
{ {
@ -111,7 +112,8 @@ namespace Generator.Helpers.Gear
} }
var template = ItemTemplateHelper.GetTemplateById(inventoryItem._tpl); var template = ItemTemplateHelper.GetTemplateById(inventoryItem._tpl);
var parentTemplate = ItemTemplateHelper.GetTemplateById(baseBot.Inventory.items.Single(i => i._id == inventoryItem.parentId)._tpl); var parentId = baseBot.Inventory.items.SingleOrDefault(i => i._id == inventoryItem.parentId)?._tpl;
var parentTemplate = parentId != null ? ItemTemplateHelper.GetTemplateById(parentId) : null;
if (!(parentTemplate?._props?.Slots?.FirstOrDefault(slot => slot._name == inventoryItem.slotId)?._required ?? false)) if (!(parentTemplate?._props?.Slots?.FirstOrDefault(slot => slot._name == inventoryItem.slotId)?._required ?? false))
{ {

View File

@ -60,7 +60,17 @@ internal static class Program
"spiritwinter", "spiritwinter",
"skier", "skier",
"peacemaker" "peacemaker",
"sectantpredvestnik",
"sectantprizrak",
"sectantoni",
"infectedassault",
"infectedpmc",
"infectedcivil",
"infectedlaborant",
"infectedtagilla",
}; };
// Read raw bot dumps and turn into c# objects // Read raw bot dumps and turn into c# objects

View File

@ -2,11 +2,11 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>