From a083065fbdf070187f464e5d09b7bb710960355d Mon Sep 17 00:00:00 2001 From: Lucca Faria Ferri Date: Sat, 4 Feb 2023 13:59:14 -0800 Subject: [PATCH] Fixed animations issue + cleanup. Added a fallback IN CASE something goes wrong - shouldn't, but left a nice log for debugging purposes. --- .../D3-GameServer/GSSystem/PowerSystem/Skill.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/PowerSystem/Skill.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/PowerSystem/Skill.cs index bb55a99..acf785f 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/PowerSystem/Skill.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/PowerSystem/Skill.cs @@ -55,9 +55,19 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem int tag = EvalTag(PowerKeys.AnimationTag); if (User.AnimationSet != null) { - if (User.AnimationSet.Animations.ContainsKey(tag)) - return User.AnimationSet.Animations[tag]; - return (AnimationSno)User.AnimationSet.GetAnimationTag(AnimationTags.Attack2); + try + { + if (User.AnimationSet.Animations.TryGetValue(tag, out AnimationSno value)) + return value; + return (AnimationSno)User.AnimationSet.GetAnimationTag(AnimationTags.Attack2); + } + catch (Exception ex) + { + #if DEBUG + Logger.Error(ex.Message, "GetActionAnimationSNO: Please don't take this error seriously, it's just a workaround for a bug in the game."); + #endif + return AnimationSno._NONE; + } } } catch (Exception e)