From 7b6f64db61174712ac942292303f7deb3d10e2c3 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 8 Jun 2024 17:47:35 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=9C=A0=EC=A0=80=EC=9E=A5=EC=9D=B4=20?= =?UTF-8?q?=EC=88=98=EB=87=8C=20=EA=B8=88=EC=A7=80=20=EC=9E=A5=EC=88=98?= =?UTF-8?q?=EB=B0=96=EC=97=90=20=EC=97=86=EC=9D=84=EB=95=8C=20NPC=20?= =?UTF-8?q?=EC=9E=84=EB=AA=85=20=EB=8F=99=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/GeneralAI.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index d4729539..08e5e717 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -3995,7 +3995,21 @@ class GeneralAI /** @var General[] */ $nextChiefs = []; - if ($userChiefCnt == 0 && $this->userGenerals && !isOfficerSet($nation['chief_set'], 11)) { + $availableUserChiefCnt = 0; + foreach($this->userGenerals as $general){ + if ($general->getVar('killturn') < $minUserKillturn) { + continue; + } + if ($general->getVar('belong') < $minBelong) { + continue; + } + if($general->hasPenalty(PenaltyKey::NoChief)){ + continue; + } + $availableUserChiefCnt += 1; + } + + if ($userChiefCnt == 0 && $availableUserChiefCnt && !isOfficerSet($nation['chief_set'], 11)) { $userGenerals = $this->userGenerals; uasort($userGenerals, function (General $lhs, General $rhs) { if ($lhs->hasPenalty(PenaltyKey::NoChief) && !$rhs->hasPenalty(PenaltyKey::NoChief)) {