From 7347c0c1af8510c20d3c800d76d2fc6ff363dbf7 Mon Sep 17 00:00:00 2001 From: kookroach Date: Tue, 6 Apr 2021 18:59:17 +0200 Subject: [PATCH] fix animation cut --- ReallifeGamemode.Client/util/animationSync.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ReallifeGamemode.Client/util/animationSync.ts b/ReallifeGamemode.Client/util/animationSync.ts index 34a5ae19..e97aed7f 100644 --- a/ReallifeGamemode.Client/util/animationSync.ts +++ b/ReallifeGamemode.Client/util/animationSync.ts @@ -68,10 +68,13 @@ blockInput = true; } } else if (!loop && player.isPlayingAnim(animDict, animName, 3) && !pair) { - if (player == mp.players.local) { - blockInput = false; - mp.events.callRemote("CLIENT:ClearAnimationData", player); - } + let a = setInterval(function () { + if (player == mp.players.local) { + blockInput = false; + mp.events.callRemote("CLIENT:ClearAnimationData", player); + } + clearInterval(a); + }, duration); } }); }, 100); @@ -79,6 +82,7 @@ mp.events.addDataHandler("AnimationData", (entity: PlayerMp, string) => { entity.clearTasksImmediately(); if (string == null) { + blockInput = false; return; }