Skip to content

Commit 274454f

Browse files
committed
add ClearPlayerTasks and fix ClearAnimations
1 parent dcd0190 commit 274454f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Server/Components/Pawn/Scripting/Player/Natives.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -415,13 +415,14 @@ SCRIPT_API(GetPlayerWorldBounds, bool(IPlayer& player, Vector4& bounds))
415415

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

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

0 commit comments

Comments
 (0)