use voiceId value directly when generating a bot + updated type to use mongoid

This commit is contained in:
Chomp
2025-08-23 18:23:17 +01:00
parent aa6d3068fc
commit fd7a576b0c
2 changed files with 2 additions and 7 deletions
@@ -235,11 +235,7 @@ public class BotGenerator(
botGenerationDetails.Role
);
bot.Info.Settings.UseSimpleAnimator = botJsonTemplate.BotExperience.UseSimpleAnimator;
var chosenVoiceName = weightedRandomHelper.GetWeightedValue(botJsonTemplate.BotAppearance.Voice);
bot.Customization.Voice = databaseService
.GetCustomization()
.FirstOrDefault(customisation => customisation.Value.Name.Equals(chosenVoiceName, StringComparison.OrdinalIgnoreCase))
.Key;
bot.Customization.Voice = weightedRandomHelper.GetWeightedValue(botJsonTemplate.BotAppearance.Voice);
bot.Health = GenerateHealth(botJsonTemplate.BotHealth, botGenerationDetails.IsPlayerScav);
bot.Skills = GenerateSkills(botJsonTemplate.BotSkills);
bot.Info.PrestigeLevel = 0;
@@ -1,4 +1,3 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using SPTarkov.Server.Core.Models.Common;
using SPTarkov.Server.Core.Models.Eft.Bot.GlobalSettings;
@@ -58,7 +57,7 @@ public record Appearance
[JsonPropertyName("voice")]
[JsonConverter(typeof(ArrayToObjectFactoryConverter))]
public Dictionary<string, double> Voice { get; set; }
public Dictionary<MongoId, double> Voice { get; set; }
}
public record Chances