fix: Insurance removing unremovable parts - #196 (#260)

* Fix insurance removing unremovable parts

* Mini optimization
This commit is contained in:
hulkhan22
2025-05-20 11:50:27 +02:00
committed by GitHub
parent 41f53a114e
commit 8ad9afebaa
2 changed files with 4 additions and 4 deletions
@@ -209,9 +209,9 @@ public class InsuranceController(
}
// Log the number of items marked for deletion, if any
if (!toDelete.Any())
if (_logger.IsLogEnabled(LogLevel.Debug))
{
if (_logger.IsLogEnabled(LogLevel.Debug))
if (toDelete.Any())
{
_logger.Debug($"Marked {toDelete.Count} items for deletion from insurance.");
}
@@ -1325,7 +1325,7 @@ public class ItemHelper(
false;
}
return itemTemplate.Key && parentTemplate.Key && (isNotRaidModdable || isRequiredSlot);
return itemTemplate.Key && parentTemplate.Key && !(isNotRaidModdable || isRequiredSlot);
}
/// <summary>
@@ -1367,7 +1367,7 @@ public class ItemHelper(
{
HashSet<string> check = ["hideout", "main"];
return !(check.Contains(item.SlotId) || _slotsAsStrings.Contains(item.SlotId) || !int.TryParse(item.SlotId, out _));
return !(check.Contains(item.SlotId) || _slotsAsStrings.Contains(item.SlotId) || int.TryParse(item.SlotId, out _));
}
/**