ambush || []

This commit is contained in:
oc 2019-03-05 02:23:02 +08:00
parent 84213fd528
commit 4b32b0c571
2 changed files with 3 additions and 3 deletions

View File

@ -684,7 +684,7 @@ control.prototype.automaticRoute = function (destX, destY) {
}
deepAdd+=core.status.checkBlock.damage[nid]*10;
// 绕过捕捉
if (core.status.checkBlock.ambush[nid])
if ((core.status.checkBlock.ambush||[])[nid])
deepAdd += 10000;
if (nx == destX && ny == destY) {
@ -1288,7 +1288,7 @@ control.prototype.checkBlock = function () {
core.snipe(snipe);
}
// 检查捕捉
var ambush = core.status.checkBlock.ambush[x+core.bigmap.width*y];
var ambush = (core.status.checkBlock.ambush||[])[x+core.bigmap.width*y];
if (core.isset(ambush)) {
// 捕捉效果
var actions = [];

View File

@ -427,7 +427,7 @@ maps.prototype.canMoveDirectly = function (destX,destY) {
if (!core.canMoveHero(nowX, nowY, dir)) continue;
var nx=nowX+directions[dir][0], ny=nowY+directions[dir][1];
if (nx<0||nx>=core.bigmap.width||ny<0||ny>=core.bigmap.height||visited[nx+core.bigmap.width*ny]||core.getBlock(nx,ny)!=null
||core.status.checkBlock.damage[nx+core.bigmap.width*ny]>0||core.status.checkBlock.ambush[nx+core.bigmap.width*ny]) continue;
||core.status.checkBlock.damage[nx+core.bigmap.width*ny]>0||(core.status.checkBlock.ambush||[])[nx+core.bigmap.width*ny]) continue;
visited[nx+core.bigmap.width*ny]=visited[nowX+core.bigmap.width*nowY]+1;
if (nx==destX&&ny==destY) return visited[nx+core.bigmap.width*ny];
queue.push(nx+core.bigmap.width*ny);