Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ClearPlayerTasks and fix ClearAnimations #453

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -415,11 +415,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