Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. Code:
  2.  
  3. public void updateNPCMovement(stream str) {
  4. if(updateRequired || direction != -1) {
  5. System.out.println("sends = "+direction);
  6. str.writeBits(1, 1);
  7. /**
  8. * self Update type is sent as 2 bits.
  9. * Only one of these is sent at once.
  10. * 0: No data to send
  11. * 1: 3 bits for direction then 1 bit for update required (?)
  12. * 2: 3 bits for 1st dir, 3 bits for 2nd dir, then 1 bit for update required (?)
  13. */
  14. if(direction != -1) {
  15. if(false) {
  16. str.writeBits(2, 2); // update type 2
  17. str.writeBits(3, Mobs.CLIENT_SPRITES[0]); // direction 1
  18. str.writeBits(3, Mobs.CLIENT_SPRITES[direction]); // direction 2
  19. str.writeBits(1, updateRequired ? 1 : 0); // is the update required?
  20. } else {
  21. str.writeBits(2, 1); // update type 1
  22. str.writeBits(3, Mobs.CLIENT_SPRITES[direction]); // direction
  23. str.writeBits(1, updateRequired ? 1 : 0); // is the update required?
  24. }
  25. } else {
  26. str.writeBits(2, 0); //don't need to move and an update is required
  27. }
  28. } else {
  29. str.writeBits(1, 0);
  30. }
  31. }
  32.  
  33.  
  34. When landed on the println msg:
  35.  
  36. Error: arch337 size mismatch in getnpcpos - pos:18 psize:20
  37. Error: T2 - 65,81,124 - 20,2609,3103 - 21,1,0,1,-1,-8,84,71,19,1,-3,127,0,0,0,3,
  38. 99,20,63,24,
  39. Exception in thread "Thread-3" java.lang.NullPointerException
  40. at client.build3dScreenMenu(client.java:6133)
  41. at client.processRightClick(client.java:8180)
  42. at client.draw3dScreen(client.java:11154)
  43. at client.method146(client.java:14758)
  44. at client.drawGameScreen(client.java:10081)
  45. at client.processDrawing(client.java:11053)
  46. at RSApplet.run(RSApplet.java:117)
  47. at client.run(client.java:6021)
  48. at java.lang.Thread.run(Unknown Source)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement