From 4cc0d98a6a839eadfee3de8f9841b1fc69e09b2c Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 15 Jun 2025 09:14:53 +0100 Subject: [PATCH] Removed PMC level check for repeatable Quest pool generation #395 they will always generate for both GZ variants --- .../Controllers/RepeatableQuestController.cs | 57 ++----------------- 1 file changed, 4 insertions(+), 53 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs b/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs index a11f0f4f..af15db36 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/RepeatableQuestController.cs @@ -708,13 +708,10 @@ public class RepeatableQuestController( /// Allowed quest pool protected QuestTypePool GenerateQuestPool(RepeatableQuestConfig repeatableConfig, int pmcLevel) { - var questPool = CreateBaseQuestPool(repeatableConfig); - - // Get the allowed locations based on the PMC's level - var locations = GetAllowedLocationsForPmcLevel(repeatableConfig.Locations, pmcLevel); + var questPool = CreateEmptyQuestPool(repeatableConfig); // Populate Exploration and Pickup quest locations - foreach (var (location, value) in locations) + foreach (var (location, value) in repeatableConfig.Locations) { if (location != ELocationName.any) { @@ -747,7 +744,7 @@ public class RepeatableQuestController( } // Target is not boss - var possibleLocations = locations.Keys; + var possibleLocations = repeatableConfig.Locations.Keys; var allowedLocations = target.Key == "Savage" ? possibleLocations.Where(location => location != ELocationName.laboratory @@ -770,7 +767,7 @@ public class RepeatableQuestController( /// /// Main repeatable config /// QuestTypePool - protected QuestTypePool CreateBaseQuestPool(RepeatableQuestConfig repeatableConfig) + protected QuestTypePool CreateEmptyQuestPool(RepeatableQuestConfig repeatableConfig) { return new QuestTypePool { @@ -793,52 +790,6 @@ public class RepeatableQuestController( }; } - /// - /// Get a dictionary of map locations the player can access based on their current level - /// - /// - /// - /// Dictionary - protected Dictionary> GetAllowedLocationsForPmcLevel( - Dictionary> locations, int pmcLevel) - { - var allowedLocation = new Dictionary>(); - foreach (var (location, matchingLocations) in locations) - { - var playerAccessibleMapIds = matchingLocations - .Where(locationName => IsPmcLevelAllowedOnLocation(locationName, pmcLevel)).ToList(); - if (playerAccessibleMapIds.Any()) - { - allowedLocation.Add(location, playerAccessibleMapIds); - } - } - - return allowedLocation; - } - - /// - /// Return true if the given pmcLevel is allowed on the given location - /// - /// location name to check - /// level of the pmc - /// True if the given pmc level is allowed to access the given location - protected bool IsPmcLevelAllowedOnLocation(string location, int pmcLevel) - { - // All PMC levels are allowed for 'any' location requirement - if (location == nameof(ELocationName.any)) - { - return true; - } - - var locationBase = _databaseService.GetLocation(location)?.Base; - if (locationBase is null) - { - return true; - } - - return pmcLevel <= locationBase.RequiredPlayerLevelMax && pmcLevel >= locationBase.RequiredPlayerLevelMin; - } - /// /// Get count of repeatable quests profile should have access to ///