Skip to content

Commit

Permalink
Merge pull request #1340 from moddio/feat-stream
Browse files Browse the repository at this point in the history
fix: use toFixed(2) for rotate.z
  • Loading branch information
moe-moe-pupil committed Sep 26, 2024
2 parents 3dc5108 + 725b621 commit 8a0f70d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gameClasses/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,9 @@ var Item = TaroEntityPhysics.extend({
}
// for client-side, translate+rotate is handled in entitiesToRender.ts
self.translateTo(x, y);
self.rotateTo(0, 0, rotate);
//FIXME: there is one very secret operation, the rotate.z is a string before I(moethun) did any update
// but somehow toFixed(2) could let it stream the correct position rather than (0, 0, 0)
self.rotateTo(0, 0, parseFloat(rotate).toFixed(2));
// added check so braains works and ai item rotation also works
} else if (!taro.physics) {
// for updating physics body of this item
Expand Down

0 comments on commit 8a0f70d

Please sign in to comment.