Fix grid filter
This commit is contained in:
2
dist/classes/Agent.js.map
vendored
2
dist/classes/Agent.js.map
vendored
File diff suppressed because one or more lines are too long
8
dist/classes/commands/GridCommands.js
vendored
8
dist/classes/commands/GridCommands.js
vendored
@@ -92,7 +92,7 @@ class GridCommands extends CommandsBase_1.CommandsBase {
|
||||
const filterMsg = packet.message;
|
||||
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;
|
||||
}
|
||||
});
|
||||
@@ -103,7 +103,7 @@ class GridCommands extends CommandsBase_1.CommandsBase {
|
||||
}).then((packet) => {
|
||||
const responseMsg = packet.message;
|
||||
responseMsg.Data.forEach((data) => {
|
||||
if (data.X === (gridX / 256) && data.Y === (gridY / 256)) {
|
||||
if (data.X === gridX && data.Y === gridY) {
|
||||
response.block = new MapBlock_1.MapBlock();
|
||||
response.block.name = Utils_1.Utils.BufferToStringSimple(data.Name);
|
||||
response.block.accessFlags = data.Access;
|
||||
@@ -124,9 +124,9 @@ class GridCommands extends CommandsBase_1.CommandsBase {
|
||||
RegionHandle: regionHandle
|
||||
};
|
||||
circuit.sendMessage(mi, PacketFlags_1.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_1.Message.MapItemReply, 10000, (packet) => {
|
||||
|
||||
2
dist/classes/commands/GridCommands.js.map
vendored
2
dist/classes/commands/GridCommands.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -26,16 +26,16 @@ let loginResponse = null;
|
||||
|
||||
bot.clientEvents.onLure.subscribe((lureEvent) =>
|
||||
{
|
||||
bot.clientCommands.grid.getRegionMapInfo(lureEvent.gridX, lureEvent.gridY).then((regionInfo) =>
|
||||
bot.clientCommands.grid.getRegionMapInfo(lureEvent.gridX / 256, lureEvent.gridY / 256).then((regionInfo) =>
|
||||
{
|
||||
if (lureEvent.from.toString() === master)
|
||||
{
|
||||
console.log('Accepting teleport lure to ' + regionInfo.name + ' (' + regionInfo.avatars.length + ' avatar' + ((regionInfo.avatars.length === 1)?'':'s') + ' present) from ' + lureEvent.fromName + ' with message: ' + lureEvent.lureMessage);
|
||||
console.log('Accepting teleport lure to ' + regionInfo.block.name + ' (' + regionInfo.avatars.length + ' avatar' + ((regionInfo.avatars.length === 1)?'':'s') + ' present) from ' + lureEvent.fromName + ' with message: ' + lureEvent.lureMessage);
|
||||
bot.clientCommands.teleport.acceptTeleport(lureEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('Ignoring teleport lure to ' + regionInfo.name + ' (' + regionInfo.avatars.length + ' avatar' + ((regionInfo.avatars.length === 1)?'':'s') + ' present) from ' + lureEvent.fromName + ' with message: ' + lureEvent.lureMessage);
|
||||
console.log('Ignoring teleport lure to ' + regionInfo.block.name + ' (' + regionInfo.avatars.length + ' avatar' + ((regionInfo.avatars.length === 1)?'':'s') + ' present) from ' + lureEvent.fromName + ' with message: ' + lureEvent.lureMessage);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user