yolkbot 0.1.1-alpha.2 → 0.1.1-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yolkbot",
3
3
  "description": "create a shell shockers (self) bot in under 10 lines.",
4
- "version": "0.1.1-alpha.2",
4
+ "version": "0.1.1-alpha.3",
5
5
  "keywords": [
6
6
  "shell shockers",
7
7
  "shellshock.io",
package/src/bot.js CHANGED
@@ -899,7 +899,15 @@ export class Bot {
899
899
  const climbing = CommIn.unPackInt8U();
900
900
 
901
901
  const player = this.players[id];
902
- if (!player) return;
902
+ if (!player || player.id == this.me.id) {
903
+ for (let i2 = 0; i2 < 3 /* FramesBetweenSyncs */; i2++) {
904
+ CommIn.unPackInt8U();
905
+ CommIn.unPackRadU();
906
+ CommIn.unPackRad();
907
+ CommIn.unPackInt8U();
908
+ }
909
+ return;
910
+ }
903
911
 
904
912
  if (player.position.x !== x) player.position.x = x;
905
913
  if (player.position.z !== z) player.position.z = z;
@@ -912,24 +920,13 @@ export class Bot {
912
920
  if (this.intents.includes(this.Intents.BUFFERS)) {
913
921
  if (!player.buffer) return;
914
922
 
915
- if (player.id == this.me.id) {
916
- for (let i2 = 0; i2 < 3 /* FramesBetweenSyncs */; i2++) {
917
- CommIn.unPackInt8U();
918
- CommIn.unPackRadU();
919
- CommIn.unPackRad();
920
- CommIn.unPackInt8U();
921
- }
922
- return;
923
- }
924
-
925
- let yaw, pitch;
926
923
  for (let i2 = 0; i2 < 3; i2++) {
927
924
  player.buffer[i2].controlKeys = CommIn.unPackInt8U();
928
925
 
929
- yaw = CommIn.unPackRadU();
926
+ const yaw = CommIn.unPackRadU();
930
927
  if (!isNaN(yaw)) player.buffer[i2].yaw_ = yaw
931
928
 
932
- pitch = CommIn.unPackRad();
929
+ const pitch = CommIn.unPackRad();
933
930
  if (!isNaN(pitch)) player.buffer[i2].pitch_ = pitch
934
931
 
935
932
  CommIn.unPackInt8U();