Skip to content

Commit

Permalink
feat(core): applyAnimation forceSyncEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
dockfries committed Jul 1, 2024
1 parent 484139f commit 387bcb9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/controllers/player/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {
WeaponEnum,
WeaponStatesEnum,
BoneIdsEnum,
ForceSyncEnum,
} from "../../enums";

import {
Expand Down Expand Up @@ -551,7 +552,7 @@ export class Player {
lockX = true,
lockY = true,
freeze = false,
forceSync = false,
forceSync: boolean | ForceSyncEnum = false,
): void {
const duration = getAnimateDurationByLibName(animLib, animName);
if (duration === undefined)
Expand All @@ -566,7 +567,7 @@ export class Player {
lockY,
freeze,
loop ? 0 : duration,
forceSync,
+forceSync,
);
}
clearAnimations(forceSync = false): void {
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/enums/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,10 @@ export enum BoneIdsEnum {
Neck,
Jaw,
}

export enum ForceSyncEnum {
UNKNOWN = -1,
NONE = 0,
ALL = 1,
OTHER = 2,
}
2 changes: 1 addition & 1 deletion packages/core/src/wrapper/native/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ export const ApplyAnimation = (
lockY: boolean,
freeze: boolean,
time: number,
forceSync: boolean,
forceSync: number,
): number => {
return samp.callNative(
"ApplyAnimation",
Expand Down

0 comments on commit 387bcb9

Please sign in to comment.