server icon indicating copy to clipboard operation
server copied to clipboard

[BUG] Default item spawn bug

Open hallowatcher opened this issue 3 years ago • 2 comments

Describe the bug If you move far enough away from a default item spawn, it will throw the following out of range exception: image

To Reproduce Steps to reproduce the behavior:

  1. Go to the wilderness
  2. Log out
  3. Log back in
  4. See error

Expected behavior No error should be thrown

Desktop (please complete the following information):

  • OS: Windows 10

Here's a video of it happening, right on the chunk where it breaks: Video

From what I dug up, it seems to be this calculation that is generating an out of range X and Y (outbound-packets.ts) image

Maybe such items shouldn't spawn for the player instance when they are so far away?

hallowatcher avatar Apr 13 '21 00:04 hallowatcher

Can confirm this is still an issue

Jameskmonger avatar Sep 07 '22 12:09 Jameskmonger

In case anyone else is searching for this issue

[2] [2022-09-07T15:02:25.898Z] ERROR (5468 on Sigexs-MBP.broadband): The value of "value" is out of range. It must be >= 0 and <= 255. Received 583
[2]     RangeError: The value of "value" is out of range. It must be >= 0 and <= 255. Received 583
[2]         at new NodeError (node:internal/errors:371:5)
[2]         at writeU_Int8 (node:internal/buffer:738:11)
[2]         at Packet.writeUInt8 (node:internal/buffer:748:10)
[2]         at Packet.put (/Users/sigex/workdir/rsps/server/node_modules/@runejs/src/buffer/byte-buffer.ts:158:40)
[2]         at OutboundPacketHandler.updateReferencePosition (/Users/sigex/workdir/rsps/server/src/engine/net/outbound-packet-handler.ts:228:16)
[2]         at OutboundPacketHandler.setWorldItem (/Users/sigex/workdir/rsps/server/src/engine/net/outbound-packet-handler.ts:181:14)
[2]         at WorldInstance.spawnWorldItem (/Users/sigex/workdir/rsps/server/src/engine/world/instances.ts:132:39)
[2]         at forEach (/Users/sigex/workdir/rsps/server/src/engine/world/world.ts:370:30)
[2]         at Array.forEach (<anonymous>)
[2]         at World.spawnWorldItems (/Users/sigex/workdir/rsps/server/src/engine/world/world.ts:367:14)

gruckion avatar Sep 07 '22 15:09 gruckion