diff --git a/ReallifeGamemode.Server/Util/AnimationSync.cs b/ReallifeGamemode.Server/Util/AnimationSync.cs index 3af3a0dd..b1f2dbf7 100644 --- a/ReallifeGamemode.Server/Util/AnimationSync.cs +++ b/ReallifeGamemode.Server/Util/AnimationSync.cs @@ -8,24 +8,11 @@ namespace ReallifeGamemode.Server.Util { public static class AnimationSync { - public static void SyncAnimation(this Player player, dynamic animations) + public static void SyncAnimation(this Player player, dynamic animationName) { if (!player.HasData("Animation")) player.SetData("Animation", String.Empty); - string animationName; - - if (animations is List) - { - animationName = animations.get(0); - List nextAnimations = animations.Skip(1); - player.TriggerEvent("SERVER:QueueAnimations", nextAnimations.ToArray(), animationName); - } - else - { - animationName = animations; - } - string currentAnimation = player.GetData("Animation"); string newAnimation = animationName; @@ -36,6 +23,14 @@ namespace ReallifeGamemode.Server.Util player.SetData("Animation", newAnimation); } + public static void SyncAnimation(this Player player, List animations) + { + string animationName = animations.ElementAt(0); + List nextAnimations = animations.Skip(1).ToList(); + player.SyncAnimation(animationName); + player.TriggerEvent("SERVER:QueueAnimations", nextAnimations.ToArray(), animationName); + } + /// Check if Player has any Animation playing. /// ///