From 28628ac9e58cb3c6a1f38398c524518ee68cea24 Mon Sep 17 00:00:00 2001 From: oc Date: Sun, 14 Apr 2019 13:23:10 +0800 Subject: [PATCH] cache --- project/functions.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/project/functions.js b/project/functions.js index 28c1e768..4e746d5e 100644 --- a/project/functions.js +++ b/project/functions.js @@ -522,7 +522,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = var guards = []; // 检查光环缓存 var index = x != null && y != null ? (x + "," + y) : "floor"; - var cache = ((core.status.checkBlock||{}).cache||{})[index]; + if (!core.status.checkBlock) core.status.checkBlock = {}; + if (!core.status.checkBlock.cache) core.status.checkBlock.cache = {}; + var cache = core.status.checkBlock.cache[index]; if (!cache) { // 没有该点的缓存,则遍历每个图块 core.status.maps[floorId].blocks.forEach(function (block) { @@ -1220,7 +1222,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = type: type, snipe: snipe, ambush: ambush, - cache: (core.status.checkBlock||{}).cache||{} + cache: {} // clear cache }; }, "moveOneStep": function (x, y) {