Better ladder animation
This commit is contained in:
@ -108,9 +108,50 @@ namespace CoopClient.Entities.Player
|
|||||||
|
|
||||||
if (IsOnLadder)
|
if (IsOnLadder)
|
||||||
{
|
{
|
||||||
if (!Function.Call<bool>(Hash.GET_IS_TASK_ACTIVE, Character.Handle, ETasks.CLIMB_LADDER))
|
if (_currentAnimation[0] != "laddersbase")
|
||||||
{
|
{
|
||||||
Character.Task.ClimbLadder();
|
_currentAnimation[0] = "laddersbase";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Math.Abs(Velocity.Z) < 0.5)
|
||||||
|
{
|
||||||
|
if (_currentAnimation[1] != "base_left_hand_up")
|
||||||
|
{
|
||||||
|
Character.Task.ClearAllImmediately();
|
||||||
|
_currentAnimation[1] = "base_left_hand_up";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Function.Call<bool>(Hash.IS_ENTITY_PLAYING_ANIM, Character.Handle, "laddersbase", "base_left_hand_up", 3))
|
||||||
|
{
|
||||||
|
Character.Task.PlayAnimation("laddersbase", "base_left_hand_up", 8f, -1, AnimationFlags.Loop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Velocity.Z > 0)
|
||||||
|
{
|
||||||
|
if (_currentAnimation[1] != "climb_up")
|
||||||
|
{
|
||||||
|
Character.Task.ClearAllImmediately();
|
||||||
|
_currentAnimation[1] = "climb_up";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Function.Call<bool>(Hash.IS_ENTITY_PLAYING_ANIM, Character.Handle, "laddersbase", "climb_up", 3))
|
||||||
|
{
|
||||||
|
Character.Task.PlayAnimation("laddersbase", "climb_up", 8f, -1, AnimationFlags.Loop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Velocity.Z < 0)
|
||||||
|
{
|
||||||
|
string anim = Velocity.Z < -2f ? "slide_climb_down" : "climb_down";
|
||||||
|
if (_currentAnimation[1] != anim)
|
||||||
|
{
|
||||||
|
Character.Task.ClearAllImmediately();
|
||||||
|
_currentAnimation[1] = anim;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Function.Call<bool>(Hash.IS_ENTITY_PLAYING_ANIM, Character.Handle, "laddersbase", anim, 3))
|
||||||
|
{
|
||||||
|
Character.Task.PlayAnimation("laddersbase", anim, 8f, -1, AnimationFlags.Loop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateOnFootPosition(true, true, false);
|
UpdateOnFootPosition(true, true, false);
|
||||||
@ -120,6 +161,7 @@ namespace CoopClient.Entities.Player
|
|||||||
if (!IsOnLadder && Function.Call<bool>(Hash.GET_IS_TASK_ACTIVE, Character.Handle, ETasks.CLIMB_LADDER))
|
if (!IsOnLadder && Function.Call<bool>(Hash.GET_IS_TASK_ACTIVE, Character.Handle, ETasks.CLIMB_LADDER))
|
||||||
{
|
{
|
||||||
Character.Task.ClearAllImmediately();
|
Character.Task.ClearAllImmediately();
|
||||||
|
_currentAnimation = new string[2] { "", "" };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsVaulting)
|
if (IsVaulting)
|
||||||
|
@ -22,7 +22,7 @@ namespace CoopClient
|
|||||||
|
|
||||||
private bool _gameLoaded = false;
|
private bool _gameLoaded = false;
|
||||||
|
|
||||||
internal static readonly string CurrentVersion = "V1_4_0";
|
internal static readonly string CurrentVersion = "V1_4_1";
|
||||||
|
|
||||||
internal static bool ShareNPCsWithPlayers = false;
|
internal static bool ShareNPCsWithPlayers = false;
|
||||||
internal static bool DisableTraffic = false;
|
internal static bool DisableTraffic = false;
|
||||||
|
Reference in New Issue
Block a user