Skip to content

Commit

Permalink
Automatically set JustResave on modifier items
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBang1112 committed Sep 15, 2024
1 parent b4e177a commit 5353faa
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,17 @@ else if (ConversionSet is not null && SubCategory is not null && Environment is
throw new Exception($"ItemInfo.Block is null - {filePath}");
}

var isJustResave = itemInfo.Block.Modifier is not "Air" and not "Ground";

var item = new BlockItem
{
FileName = Path.GetFileName(filePath),
Block = block,
Modifier = itemInfo.Block.Modifier ?? throw new Exception($"ItemInfo.Block.Modifier is null - {filePath}"),
Variant = itemInfo.Block.Variant,
SubVariant = itemInfo.Block.SubVariant,
JustResave = isJustResave,
Value = isJustResave ? 1 : 0
};

await Db.BlockItems.AddAsync(item);
Expand Down

0 comments on commit 5353faa

Please sign in to comment.