Improved handling of null location id inside GetRoubleValue

This commit is contained in:
Chomp
2025-07-18 09:38:13 +01:00
parent 843b1ad780
commit 80624ece4d
@@ -10,7 +10,7 @@ namespace SPTarkov.Server.Core.Extensions
public static double GetRoubleValue(
this LootContainerSettings settings,
int botLevel,
string locationId
string? locationId
)
{
var roubleTotalByLevel = GetContainerRoubleTotalByLevel(
@@ -18,10 +18,18 @@ namespace SPTarkov.Server.Core.Extensions
settings.TotalRubByLevel
);
if (locationId is null)
{
return roubleTotalByLevel;
}
// Get multiplier for map, use default if map not found
if (!settings.LocationMultipler.TryGetValue(locationId, out var multiplier))
{
settings.LocationMultipler.TryGetValue("default", out multiplier);
if (!settings.LocationMultipler.TryGetValue("default", out multiplier))
{
return roubleTotalByLevel;
}
}
return roubleTotalByLevel * multiplier;