fix: 유저장이 수뇌 금지 장수밖에 없을때 NPC 임명 동작

This commit is contained in:
2024-06-08 17:47:35 +00:00
parent 06f086bcf0
commit 7b6f64db61
+15 -1
View File
@@ -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)) {