From 2e648b430095edcb3624d4ac7c073a1fa3c1baac Mon Sep 17 00:00:00 2001 From: kookroach Date: Tue, 6 Apr 2021 18:25:30 +0200 Subject: [PATCH] fix --- ReallifeGamemode.Client/util/animationSync.ts | 3 ++- ReallifeGamemode.Server/Extensions/ClientExtension.cs | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Client/util/animationSync.ts b/ReallifeGamemode.Client/util/animationSync.ts index 26bf4694..bc72c362 100644 --- a/ReallifeGamemode.Client/util/animationSync.ts +++ b/ReallifeGamemode.Client/util/animationSync.ts @@ -58,6 +58,7 @@ let index = mp.game.joaat(player.getVariable("AnimationData")); let currentAnim = animationSyncData.animations[index]; let { id, name, animDict, animName, duration, loop, flag } = currentAnim; + let pair = pairData.find(pair => pair.from == name); if (loop && !player.isPlayingAnim(animDict, animName, 3)) { loadAnimDict(animDict, function () { @@ -66,7 +67,7 @@ if (player == mp.players.local) { blockInput = true; } - } else if (!loop && player.isPlayingAnim(animDict, animName, 3)) { + } else if (!loop && player.isPlayingAnim(animDict, animName, 3) && !pair) { if (player == mp.players.local) { blockInput = false; mp.events.callRemote("CLIENT:ClearAnimationData", player); diff --git a/ReallifeGamemode.Server/Extensions/ClientExtension.cs b/ReallifeGamemode.Server/Extensions/ClientExtension.cs index ba689464..02be10d0 100644 --- a/ReallifeGamemode.Server/Extensions/ClientExtension.cs +++ b/ReallifeGamemode.Server/Extensions/ClientExtension.cs @@ -319,8 +319,13 @@ namespace ReallifeGamemode.Server.Extensions public static Vector3 GetInFrontOfPosition(this Player player) { + player.ResetData("InFrontOf"); player.TriggerEvent("SERVER:GetInFrontPosition"); - return player.GetData("InFrontOf"); + while (true) + { + if (player.HasData("InFrontOf")) + return player.GetData("InFrontOf"); + } } } }