Fix cast & filtering

This commit is contained in:
hulkhan22
2025-04-29 00:33:40 +02:00
parent 727c71de54
commit 9357c1d2b9
@@ -279,21 +279,20 @@ public class RepeatableQuestGenerator(
if (distance > 50)
{
List<string> weaponTypeBlacklist = ["Shotgun", "Pistol"];
weaponCategoryRequirementConfig =
(ProbabilityObjectArray<string, List<string>>) weaponCategoryRequirementConfig
.Where(category => weaponTypeBlacklist
.Contains(category.Key)
);
// Filter out close range weapons from long distance requirement
weaponCategoryRequirementConfig
.RemoveAll(category => weaponTypeBlacklist
.Contains(category.Key));
}
else if (distance < 20)
{
List<string> weaponTypeBlacklist = ["MarksmanRifle", "DMR"];
// Filter out far range weapons from close distance requirement
weaponCategoryRequirementConfig =
(ProbabilityObjectArray<string, List<string>>) weaponCategoryRequirementConfig
.Where(category => weaponTypeBlacklist
.Contains(category.Key)
);
weaponCategoryRequirementConfig
.RemoveAll(category => weaponTypeBlacklist
.Contains(category.Key));
}
// Pick a weighted weapon category