From 62e997be05d2d079730727d7c74d1052ef42747a Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Tue, 6 Feb 2024 10:35:20 +0800 Subject: [PATCH] =?UTF-8?q?get.order=E5=92=8Cget.cacheOrder=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=AC=AC=E4=BA=8C=E4=B8=AA=E8=A7=92=E8=89=B2=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/get/index.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/noname/get/index.js b/noname/get/index.js index 9604218ab..e37921a72 100644 --- a/noname/get/index.js +++ b/noname/get/index.js @@ -4201,11 +4201,11 @@ export class Get extends Uninstantable { } return 1; } - static cacheOrder(item){ + static cacheOrder(item, player){ let cache = CacheContext.requireCacheContext(); - return cache.get.order(item); + return cache.get.order(item, player); } - static order(item) { + static order(item, player) { let cache = CacheContext.requireCacheContext(); var info = get.info(item); if (!info) return -1; @@ -4214,13 +4214,12 @@ export class Get extends Uninstantable { if (aii && aii.order) order = aii.order; else if (aii && aii.basic) order = aii.basic.order; if (order == undefined) return -1; - var num = order; + var num = order, target = (player || _status.event.player); if (typeof (order) == 'function') { - num = order(item, _status.event.player); + num = order(item, target); } - if (typeof item == 'object' && _status.event.player) { - var player = _status.event.player; - num = game.checkMod(player, item, num, 'aiOrder', player); + if (typeof item == 'object' && target) { + num = game.checkMod(target, item, num, 'aiOrder', target); } return num; }