Skip to content

Commit

Permalink
fix: Fix 3.23.1 live parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
octfx committed May 18, 2024
1 parent 704c96a commit 7cecfd9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Loader/ItemBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ List<string> BuildTagList(EntityClassDefinition entity)
{
var tags = new List<string>();

var tagString = entity.Components.SAttachableComponentParams?.AttachDef.Tags;
if (entity?.Components?.SAttachableComponentParams?.AttachDef?.Tags == null) return tags;

var tagString = entity.Components?.SAttachableComponentParams?.AttachDef?.Tags;
if (tagString != null)
{
foreach (var tag in tagString.Split(" "))
Expand Down
2 changes: 1 addition & 1 deletion Loader/ItemClassifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public string Classify(EntityClassDefinition entity)
{
if (!match.Matcher(entity)) continue;

var classification = match.Classifier(entity.Components?.SAttachableComponentParams?.AttachDef.Type, entity.Components?.SAttachableComponentParams.AttachDef.SubType);
var classification = match.Classifier(entity.Components?.SAttachableComponentParams?.AttachDef.Type, entity.Components?.SAttachableComponentParams?.AttachDef?.SubType);
if (classification?.EndsWith(".UNDEFINED") ?? false) classification = classification.Substring(0, classification.Length - 10);

return classification;
Expand Down
2 changes: 1 addition & 1 deletion Loader/ItemInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void InstallLoadout(StandardisedItem item, List<StandardisedLoadoutEntry>

public void InstallLoadout(EntityClassDefinition item, List<StandardisedLoadoutEntry> loadout)
{
if (item?.Components?.SItemPortContainerComponentParams?.Ports == null)
if (item == null || item?.Components?.SItemPortContainerComponentParams?.Ports == null)
{
return;
}
Expand Down
4 changes: 2 additions & 2 deletions Loader/scdb.Xml/Vehicles/AngleRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace scdb.Xml.Vehicles
public class AngleRange
{
[XmlAttribute]
public int min;
public string min;

[XmlAttribute]
public int max;
public string max;
}
}

0 comments on commit 7cecfd9

Please sign in to comment.