Fix grid coordinate checks

This commit is contained in:
Casper Warden
2018-04-07 22:07:13 +01:00
parent 0790fc30a3
commit 16aa98268d
2 changed files with 5 additions and 5 deletions

View File

@@ -111,7 +111,7 @@ export class GridCommands extends CommandsBase
let found = false;
filterMsg.Data.forEach((data) =>
{
if (data.X === (gridX / 256) && data.Y === (gridY / 256))
if (data.X === gridX && data.Y === gridY)
{
found = true;
}
@@ -126,7 +126,7 @@ export class GridCommands extends CommandsBase
const responseMsg = packet.message as MapBlockReplyMessage;
responseMsg.Data.forEach((data) =>
{
if (data.X === (gridX / 256) && data.Y === (gridY / 256))
if (data.X === gridX && data.Y === gridY)
{
response.block = new MapBlock();
response.block.name = Utils.BufferToStringSimple(data.Name);
@@ -151,9 +151,9 @@ export class GridCommands extends CommandsBase
RegionHandle: regionHandle
};
circuit.sendMessage(mi, PacketFlags.Reliable);
const minX = Math.floor(gridX / 256) * 256;
const minX = gridX;
const maxX = minX + 256;
const minY = Math.floor(gridY / 256) * 256;
const minY = gridY;
const maxY = minY + 256;
response.avatars = [];
circuit.waitForMessage(Message.MapItemReply, 10000, (packet: Packet): FilterResponse =>

View File

@@ -1,6 +1,6 @@
{
"name": "@caspertech/node-metaverse",
"version": "0.4.3",
"version": "0.4.4",
"description": "A node.js interface for Second Life.",
"main": "dist/index.js",
"types": "dist/index.d.ts",