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 Jul 9, 2022
1 parent 4d3fbcf commit c15b656
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Server/Components/Pawn/Scripting/Player/Natives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,12 @@ 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.clearAnimations(PlayerAnimationSyncType(syncType));
return true;
}

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

0 comments on commit c15b656

Please sign in to comment.