Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -628,18 +628,18 @@ protected void ReplaceBotHostility(
continue;
}

// Try to get map 'default' first if it exists
if (!hostilitySettings.TryGetValue("default", out var newHostilitySettings))
// Try for location-specific hostility settings first
if (!hostilitySettings.TryGetValue(locationBase.Base.Id.ToLowerInvariant(), out var newHostilitySettings))
{
// No 'default', try for location name
if (!hostilitySettings.TryGetValue(locationName, out newHostilitySettings))
// If we don't have location-specific, fall back to defaults
if (!hostilitySettings.TryGetValue("default", out newHostilitySettings))
{
// no settings for map by name, skip map
// No settings by map, or default fallback, skip map
continue;
}
}

if (locationWhitelist is not null && !locationWhitelist.Contains(locationName))
if (locationWhitelist is not null && !locationWhitelist.Contains(locationBase.Base.Id.ToLowerInvariant()))
{
continue;
}
Expand Down Expand Up @@ -823,7 +823,7 @@ protected void ConfigureZombies(ZombieSettings zombieSettings)
/// Get location ids of maps with an infection above 0
/// </summary>
/// <param name="locationInfections">Dict of locations with their infection percentage</param>
/// <returns>List of location ids</returns>
/// <returns>List of lowercased location ids</returns>
protected HashSet<string> GetLocationsWithZombies(Dictionary<string, double> locationInfections)
{
var result = new HashSet<string>();
Expand All @@ -834,7 +834,7 @@ protected HashSet<string> GetLocationsWithZombies(Dictionary<string, double> loc
// Convert the infected location id into its generic location id
foreach (var location in infectionKeys)
{
result.UnionWith(GetLocationFromInfectedLocation(location.Key));
result.UnionWith(GetLocationFromInfectedLocation(location.Key.ToLowerInvariant()));
}

return result;
Expand All @@ -850,7 +850,7 @@ protected List<string> GetLocationFromInfectedLocation(string infectedLocationKe
return infectedLocationKey switch
{
"factory4" => ["factory4_day", "factory4_night"],
"Sandbox" => ["sandbox", "sandbox_high"],
"sandbox" => ["sandbox", "sandbox_high"],
_ => [infectedLocationKey],
};
}
Expand Down Expand Up @@ -910,7 +910,8 @@ protected void AddEventBossesToMaps(string eventType, HashSet<string>? mapIdWhit
var mapBosses = ((Location)locations[locationName]).Base.BossLocationSpawn;
foreach (var boss in bossesToAdd)
{
if (mapBosses.All(bossSpawn => bossSpawn.BossName != boss.BossName))
// Don't re-add bosses that already exist, unless they're event bosses
if (mapBosses.All(bossSpawn => bossSpawn.TriggerName == "botEvent" || bossSpawn.BossName != boss.BossName))
{
// Boss doesn't exist in maps boss list yet, add
mapBosses.Add(boss);
Expand Down
Loading