Don't apply hostility changes to maps without zombies during halloween
`ReplaceBotHostiltiy` has optional map whitelist param
This commit is contained in:
@@ -457,7 +457,10 @@ public class SeasonalEventService(
|
||||
|
||||
if (eventType.Settings?.ReplaceBotHostility ?? false)
|
||||
{
|
||||
ReplaceBotHostility(SeasonalEventConfig.HostilitySettingsForEvent.FirstOrDefault(x => x.Key == "zombies").Value);
|
||||
ReplaceBotHostility(
|
||||
SeasonalEventConfig.HostilitySettingsForEvent.FirstOrDefault(x => x.Key == "zombies").Value,
|
||||
GetLocationsWithZombies(eventType.Settings.ZombieSettings.MapInfectionAmount)
|
||||
);
|
||||
}
|
||||
|
||||
if (eventType.Settings?.AdjustBotAppearances ?? false)
|
||||
@@ -602,7 +605,10 @@ public class SeasonalEventService(
|
||||
}
|
||||
}
|
||||
|
||||
protected void ReplaceBotHostility(Dictionary<string, List<AdditionalHostilitySettings>> hostilitySettings)
|
||||
protected void ReplaceBotHostility(
|
||||
Dictionary<string, List<AdditionalHostilitySettings>> hostilitySettings,
|
||||
HashSet<string>? locationWhitelist = null
|
||||
)
|
||||
{
|
||||
var locations = databaseService.GetLocations().GetDictionary();
|
||||
var ignoreList = LocationConfig.NonMaps;
|
||||
@@ -630,6 +636,11 @@ public class SeasonalEventService(
|
||||
}
|
||||
}
|
||||
|
||||
if (locationWhitelist is not null && !locationWhitelist.Contains(locationName))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var settings in newHostilitySettings)
|
||||
{
|
||||
var matchingBaseSettings = locationBase.Base.BotLocationModifier?.AdditionalHostilitySettings?.FirstOrDefault(x =>
|
||||
|
||||
Reference in New Issue
Block a user