From 2f189ad00aa523cd181a0b3b1088021ace7d08b5 Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 27 Jan 2025 13:51:31 +0000 Subject: [PATCH] Better system to get exp reward value from bot --- Libraries/Core/Generators/BotGenerator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/Core/Generators/BotGenerator.cs b/Libraries/Core/Generators/BotGenerator.cs index d773f119..86f33b76 100644 --- a/Libraries/Core/Generators/BotGenerator.cs +++ b/Libraries/Core/Generators/BotGenerator.cs @@ -319,10 +319,10 @@ public class BotGenerator( /// Experience for kill public double GetExperienceRewardForKillByDifficulty(Dictionary experiences, string botDifficulty, string role) { - var result = experiences[botDifficulty.ToLower()]; - if (result is null) + + if (!experiences.TryGetValue(botDifficulty.ToLower(), out var result)) { - _logger.Debug($"Unable to find experience for kill value for: { role} { botDifficulty}, falling back to `normal`"); + _logger.Debug($"Unable to find experience: {botDifficulty} for {role} bot, falling back to `normal`"); return _randomUtil.GetDouble(experiences["normal"].Min.Value, experiences["normal"].Max.Value); }