Open hallowatcher opened 3 years ago
Can confirm this is still an issue
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)
Describe the bug If you move far enough away from a default item spawn, it will throw the following out of range exception:
To Reproduce Steps to reproduce the behavior:
Expected behavior No error should be thrown
Desktop (please complete the following information):
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)
Maybe such items shouldn't spawn for the player instance when they are so far away?