Skip to content

Commit

Permalink
add ClearPlayerTasks and fix ClearAnimations
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyrAhmady committed Jan 9, 2023
1 parent dcd0190 commit 274454f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Server/Components/Pawn/Scripting/Player/Natives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,14 @@ SCRIPT_API(GetPlayerWorldBounds, bool(IPlayer& player, Vector4& bounds))

SCRIPT_API(ClearAnimations, bool(IPlayer& player, int syncType))
{
// TODO: This must be fixed on client side
// At the moment ClearAnimations flushes all tasks applied to player
// Including driving, siting in vehicle, shooting, jumping, or any sort of a task
// And it doesn't just clear applied animations, in order to keep it compatible with
// Current samp scripts without requiring a change, we call IPlayer::clearTasks temporarily.
player.clearTasks(PlayerAnimationSyncType(syncType));
return true;
player.clearAnimations(PlayerAnimationSyncType(syncType));
return true;
}

SCRIPT_API(ClearPlayerTasks, bool(IPlayer& player, int syncType))
{
player.clearTasks(PlayerAnimationSyncType(syncType));
return true;
}

SCRIPT_API(GetPlayerLastShotVectors, bool(IPlayer& player, Vector3& origin, Vector3& hitPos))
Expand Down

0 comments on commit 274454f

Please sign in to comment.