forked from devsam/core
fix: 유저장이 수뇌 금지 장수밖에 없을때 NPC 임명 동작
This commit is contained in:
+15
-1
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user