fix: 大地图寻路

This commit is contained in:
unanmed 2024-11-20 21:47:32 +08:00
parent 0d498a9437
commit 57ebcb4461

View File

@ -809,18 +809,23 @@ maps.prototype.generateMovableArray = function (floorId) {
const loopMaps = Mota.require('module', 'Mechanism').MiscData.loopMaps; const loopMaps = Mota.require('module', 'Mechanism').MiscData.loopMaps;
const isLoop = loopMaps.has(floorId); const isLoop = loopMaps.has(floorId);
var v2 = floorId == core.status.floorId && core.bigmap.v2; var v2 = floorId == core.status.floorId && core.bigmap.v2;
var startX = v2 ? Math.max(0, core.bigmap.posX - core.bigmap.extend) : 0; const half = core._HALF_WIDTH_;
var startX = v2
? Math.max(0, core.bigmap.posX - half - core.bigmap.extend)
: 0;
var endX = v2 var endX = v2
? Math.min( ? Math.min(
width, width,
core.bigmap.posX + core._WIDTH_ + core.bigmap.extend + 1 core.bigmap.posX + core._WIDTH_ - half + core.bigmap.extend + 1
) )
: width; : width;
var startY = v2 ? Math.max(0, core.bigmap.posY - core.bigmap.extend) : 0; var startY = v2
? Math.max(0, core.bigmap.posY - half - core.bigmap.extend)
: 0;
var endY = v2 var endY = v2
? Math.min( ? Math.min(
height, height,
core.bigmap.posY + core._HEIGHT_ + core.bigmap.extend + 1 core.bigmap.posY + core._HEIGHT_ - half + core.bigmap.extend + 1
) )
: height; : height;