mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-12 13:10:43 -05:00
Added missing MainProfileNickname
property when generating a player scav character
This commit is contained in:
parent
c40a4aa7cb
commit
e04fa4d8fe
@ -6,6 +6,7 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||
import { MinMax } from "@spt/models/common/MinMax";
|
||||
import { IWildBody } from "@spt/models/eft/common/IGlobals";
|
||||
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||
import {
|
||||
Common,
|
||||
IBaseJsonSkills,
|
||||
@ -71,9 +72,16 @@ export class BotGenerator {
|
||||
* @param role e.g. assault / pmcbot
|
||||
* @param difficulty easy/normal/hard/impossible
|
||||
* @param botTemplate base bot template to use (e.g. assault/pmcbot)
|
||||
* @returns
|
||||
* profile PMC profile of player generating pscav
|
||||
* @returns IBotBase
|
||||
*/
|
||||
public generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase {
|
||||
public generatePlayerScav(
|
||||
sessionId: string,
|
||||
role: string,
|
||||
difficulty: string,
|
||||
botTemplate: IBotType,
|
||||
profile: IPmcData,
|
||||
): IBotBase {
|
||||
let bot = this.getCloneOfBotBase();
|
||||
bot.Info.Settings.BotDifficulty = difficulty;
|
||||
bot.Info.Settings.Role = role;
|
||||
@ -92,6 +100,9 @@ export class BotGenerator {
|
||||
|
||||
bot = this.generateBot(sessionId, bot, botTemplate, botGenDetails);
|
||||
|
||||
// Sets the name after scav name shown in parenthesis
|
||||
bot.Info.MainProfileNickname = profile.Info.Nickname;
|
||||
|
||||
return bot;
|
||||
}
|
||||
|
||||
@ -165,6 +176,7 @@ export class BotGenerator {
|
||||
bot,
|
||||
);
|
||||
|
||||
// Only filter bot equipment, never players
|
||||
if (!botGenerationDetails.isPlayerScav) {
|
||||
this.botEquipmentFilterService.filterBotEquipment(
|
||||
sessionId,
|
||||
|
@ -58,8 +58,9 @@ export class PlayerScavGenerator {
|
||||
public generate(sessionID: string): IPmcData {
|
||||
// get karma level from profile
|
||||
const profile = this.saveServer.getProfile(sessionID);
|
||||
const pmcDataClone = this.cloner.clone(profile.characters.pmc);
|
||||
const existingScavDataClone = this.cloner.clone(profile.characters.scav);
|
||||
const profileCharactersClone = this.cloner.clone(profile.characters);
|
||||
const pmcDataClone = profileCharactersClone.pmc;
|
||||
const existingScavDataClone = profileCharactersClone.scav;
|
||||
|
||||
const scavKarmaLevel = this.getScavKarmaLevel(pmcDataClone);
|
||||
|
||||
@ -80,6 +81,7 @@ export class PlayerScavGenerator {
|
||||
playerScavKarmaSettings.botTypeForLoot.toLowerCase(),
|
||||
"easy",
|
||||
baseBotNode,
|
||||
pmcDataClone,
|
||||
);
|
||||
|
||||
// Remove cached bot data after scav was generated
|
||||
|
Loading…
x
Reference in New Issue
Block a user