Move variable calculation outside of loop
This commit is contained in:
parent
c116adc0b9
commit
9520a2977e
@ -166,6 +166,7 @@ export class BotController
|
|||||||
*/
|
*/
|
||||||
protected generateBotsFirstTime(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): IBotBase[]
|
protected generateBotsFirstTime(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): IBotBase[]
|
||||||
{
|
{
|
||||||
|
const allPmcsHaveSameNameAsPlayer = this.randomUtil.getChance100(this.pmcConfig.allPMCsHavePlayerNameWithRandomPrefixChance);
|
||||||
for (const condition of request.conditions)
|
for (const condition of request.conditions)
|
||||||
{
|
{
|
||||||
const botGenerationDetails: BotGenerationDetails = {
|
const botGenerationDetails: BotGenerationDetails = {
|
||||||
@ -179,7 +180,7 @@ export class BotController
|
|||||||
botCountToGenerate: this.botConfig.presetBatch[condition.Role],
|
botCountToGenerate: this.botConfig.presetBatch[condition.Role],
|
||||||
botDifficulty: condition.Difficulty,
|
botDifficulty: condition.Difficulty,
|
||||||
isPlayerScav: false,
|
isPlayerScav: false,
|
||||||
allPmcsHaveSameNameAsPlayer: this.randomUtil.getChance100(this.pmcConfig.allPMCsHavePlayerNameWithRandomPrefixChance)
|
allPmcsHaveSameNameAsPlayer: allPmcsHaveSameNameAsPlayer
|
||||||
};
|
};
|
||||||
|
|
||||||
// Event bots need special actions to occur, set data up for them
|
// Event bots need special actions to occur, set data up for them
|
||||||
|
Loading…
Reference in New Issue
Block a user