Feature: Ensure chosen extract for repeatable quest always has a chance above 0 (!68)
Co-authored-by: Dev <dev@noreply.dev.sp-tarkov.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/68
This commit is contained in:
parent
510972a996
commit
f74031b4d5
@ -435,12 +435,13 @@ export class RepeatableQuestController
|
|||||||
|
|
||||||
if (Math.random() < repeatableConfig.questConfig.Exploration.specificExits.probability)
|
if (Math.random() < repeatableConfig.questConfig.Exploration.specificExits.probability)
|
||||||
{
|
{
|
||||||
// Filter by whitelist, it's also possible that the field "PassageRequirement" does not exist (e.g. shoreline)
|
// Filter by whitelist, it's also possible that the field "PassageRequirement" does not exist (e.g. Shoreline)
|
||||||
// Scav exits are not listed at all in locations.base currently. If that changes at some point, additional filtering will be required
|
// Scav exits are not listed at all in locations.base currently. If that changes at some point, additional filtering will be required
|
||||||
const possibleExists = (this.databaseServer.getTables().locations[locationKey.toLowerCase()].base as ILocationBase).exits.filter(
|
const mapExits = (this.databaseServer.getTables().locations[locationKey.toLowerCase()].base as ILocationBase).exits;
|
||||||
x => !("PassageRequirement" in x)
|
const possibleExists = mapExits.filter(
|
||||||
|| repeatableConfig.questConfig.Exploration.specificExits.passageRequirementWhitelist.includes(x.PassageRequirement)
|
x => (!("PassageRequirement" in x)
|
||||||
|| x.Chance > 0
|
|| repeatableConfig.questConfig.Exploration.specificExits.passageRequirementWhitelist.includes(x.PassageRequirement))
|
||||||
|
&& x.Chance > 0
|
||||||
);
|
);
|
||||||
const exit = this.randomUtil.drawRandomFromList(possibleExists, 1)[0];
|
const exit = this.randomUtil.drawRandomFromList(possibleExists, 1)[0];
|
||||||
const exitCondition = this.generateExplorationExitCondition(exit);
|
const exitCondition = this.generateExplorationExitCondition(exit);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user