From 332d07630e2b42baebc77b96eb0d36209f0ff305 Mon Sep 17 00:00:00 2001 From: kookroach Date: Tue, 6 Apr 2021 04:52:30 +0200 Subject: [PATCH] . --- ReallifeGamemode.Client/util/animationSync.ts | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/ReallifeGamemode.Client/util/animationSync.ts b/ReallifeGamemode.Client/util/animationSync.ts index 87d43dd5..f33cfdad 100644 --- a/ReallifeGamemode.Client/util/animationSync.ts +++ b/ReallifeGamemode.Client/util/animationSync.ts @@ -77,8 +77,10 @@ export default function animationSync() { let index = mp.game.joaat(string); let animData = animationSyncData.animations[index]; - if (!animData) + if (!animData) { clearInterval(a); + return; + } let { id, name, animDict, animName, duration, loop, flag } = animData; @@ -87,19 +89,21 @@ export default function animationSync() { mp.players.exists(entity) && 0 !== entity.handle && entity.taskPlayAnim(animDict, animName, 1, 0, -1, parseInt(flag), 0, !1, !1, !1) }); playAnim = false; + + let pair = pairData.find(pair => pair.from == string); + if (!pair) { + clearInterval(a); + return; + } + + let b = setInterval(function () { + string = pair.transitionTo; + mp.gui.chat.push("transition to " + string); + playAnim = true; + entity.clearTasksImmediately(); + clearInterval(b); + }, duration); } - - let pair = pairData.find(pair => pair.from == string); - if (!pair) - clearInterval(a); - - let b = setInterval(function () { - string = pair.transitionTo; - mp.gui.chat.push("transition to " + string); - playAnim = true; - entity.clearTasksImmediately(); - clearInterval(b); - }, duration); }, 200); });