From e34cd3bd0175fd8a19c6b0d644dbd597179b7c72 Mon Sep 17 00:00:00 2001 From: kookroach Date: Wed, 7 Apr 2021 00:26:11 +0200 Subject: [PATCH] fix ? --- ReallifeGamemode.Client/util/animationSync.ts | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/ReallifeGamemode.Client/util/animationSync.ts b/ReallifeGamemode.Client/util/animationSync.ts index 70a20b7f..c38d5052 100644 --- a/ReallifeGamemode.Client/util/animationSync.ts +++ b/ReallifeGamemode.Client/util/animationSync.ts @@ -74,19 +74,6 @@ }); }, 100); - mp.events.add("SERVER:QueueAnimations", (currentAnimation) => { - let index = mp.game.joaat(currentAnimation); - if (!animationSyncData.animations.hasOwnProperty(index)) return; - let currentAnim = animationSyncData.animations[index]; - let { id, name, animDict, animName, duration, loop, flag } = currentAnim; - - let interval = setInterval(function () { - mp.events.callRemote("CLIENT:AnimPairTransition"); - - clearInterval(interval); - }, duration); - }); - mp.events.addDataHandler("AnimationData", (entity: PlayerMp, string) => { entity.clearTasksImmediately(); if (string == null) { @@ -107,9 +94,9 @@ if (!loop) { let a = setInterval(function () { - if (entity == mp.players.local) { - mp.events.callRemote("CLIENT:ClearAnimationData", entity); - } + mp.events.callRemote("CLIENT:ClearAnimationData", entity); + mp.events.callRemote("CLIENT:AnimPairTransition"); + clearInterval(a); }, duration); }