runejs / server

RuneJS is a RuneScape game server written in TypeScript and JavaScript. The goal of the project is to create a comprehensive game engine, while also providing simple and easy to use content development systems and APIs.
GNU General Public License v3.0
238 stars 82 forks source link

[BUG] Animations are cancelled after one tick #398

Closed Jameskmonger closed 1 year ago

Jameskmonger commented 1 year ago

Describe the bug Animations are cancelled after one tick of playing, they should continue to play to the end.

To Reproduce Steps to reproduce the behavior:

  1. Run an emote such as "Jump for joy", you will notice it doesn't complete
  2. If you spam-click the animation button, the emote will complete

Expected behavior The emote should run to its finish.

Additional context

I was able to fix this locally by going into player-sync-task.ts and changing the updateFlags.animation !== undefined checks to updateFlags.animation !== undefined && updateFlags.animation !== null.

The issue is that the "Reset animation" part is being called every tick, thus setting the animation back to -1.

Possibly we can just remove the undefined check entirely, and only check against null.