Moved shotgun tpls from FixShotgunDispersions to config
This commit is contained in:
@@ -14,6 +14,12 @@
|
||||
},
|
||||
"fixes": {
|
||||
"fixShotgunDispersion": true,
|
||||
"shotgunIdsToFix": [
|
||||
"576165642459773c7a400233",
|
||||
"5a38e6bac4a2826c6e06d79b",
|
||||
"5a7828548dc32e5a9c28b516",
|
||||
"674fe9a75e51f1c47c04ec23"
|
||||
],
|
||||
"removeModItemsFromProfile": false,
|
||||
"removeInvalidTradersFromProfile": false,
|
||||
"fixProfileBreakingInventoryItemIssues": false
|
||||
|
||||
@@ -180,6 +180,9 @@ public record GameFixes
|
||||
[JsonPropertyName("fixShotgunDispersion")]
|
||||
public bool FixShotgunDispersion { get; set; }
|
||||
|
||||
[JsonPropertyName("shotgunIdsToFix")]
|
||||
public IEnumerable<MongoId> ShotgunIdsToFix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load
|
||||
/// </summary>
|
||||
|
||||
@@ -54,7 +54,7 @@ public class PostDbLoadService(
|
||||
|
||||
if (CoreConfig.Fixes.FixShotgunDispersion)
|
||||
{
|
||||
FixShotgunDispersions();
|
||||
FixShotgunDispersions(CoreConfig.Fixes.ShotgunIdsToFix);
|
||||
}
|
||||
|
||||
if (LocationConfig.AddOpenZonesToAllMaps)
|
||||
@@ -407,18 +407,11 @@ public class PostDbLoadService(
|
||||
}
|
||||
|
||||
// BSG have two values for shotgun dispersion, we make sure both have the same value
|
||||
protected void FixShotgunDispersions()
|
||||
protected void FixShotgunDispersions(IEnumerable<MongoId> shotgunIds)
|
||||
{
|
||||
var itemDb = databaseService.GetItems();
|
||||
|
||||
var shotguns = new List<MongoId>
|
||||
{
|
||||
Weapons.SHOTGUN_12G_SAIGA_12K,
|
||||
Weapons.SHOTGUN_20G_TOZ_106,
|
||||
Weapons.SHOTGUN_12G_M870,
|
||||
Weapons.SHOTGUN_12G_SAIGA_12K_FA,
|
||||
};
|
||||
foreach (var shotgunId in shotguns)
|
||||
foreach (var shotgunId in shotgunIds)
|
||||
{
|
||||
if (itemDb.TryGetValue(shotgunId, out var shotgun) && shotgun.Properties.ShotgunDispersion.HasValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user