diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs index a83fe672..05922c47 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs @@ -70,6 +70,12 @@ public class BotGenerator( bot = GenerateBot(sessionId, bot, botTemplate, botGenDetails); + // Pscavs in live have same limb hp as their pmc character + if (profile?.Health?.BodyParts is not null) + { + CopyLimbHpValuesToBot(bot, profile.Health.BodyParts); + } + // Sets the name after scav name shown in parentheses bot.Info.MainProfileNickname = profile.Info.Nickname; @@ -104,10 +110,19 @@ public class BotGenerator( WishList = bot.WishList, MoneyTransferLimitData = bot.MoneyTransferLimitData, IsPmc = bot.IsPmc, - Prestige = new Dictionary(), + Prestige = [], }; } + protected void CopyLimbHpValuesToBot(BotBase bot, Dictionary bodyParts) + { + foreach (var (partName, partProperties) in bodyParts) + { + bot.Health.BodyParts[partName].Health.Maximum = partProperties.Health.Maximum; + bot.Health.BodyParts[partName].Health.Current = bot.Health.BodyParts[partName].Health.Maximum; + } + } + /// /// Create 1 bot of the type/side/difficulty defined in botGenerationDetails ///