NPC 수뇌 임명 버그 수정
This commit is contained in:
@@ -1791,13 +1791,13 @@ class GeneralAI{
|
|||||||
$iterCandChiefStrength = new \ArrayIterator($candChiefStrength);
|
$iterCandChiefStrength = new \ArrayIterator($candChiefStrength);
|
||||||
$iterCandChiefIntel = new \ArrayIterator($candChiefIntel);
|
$iterCandChiefIntel = new \ArrayIterator($candChiefIntel);
|
||||||
|
|
||||||
foreach(range(10, $minChiefLevel, -1) as $cheifLevel){
|
foreach(range(10, $minChiefLevel, -1) as $chiefLevel){
|
||||||
if(key_exists($cheifLevel, $chiefCandidate)){
|
if(key_exists($chiefLevel, $chiefCandidate)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var \ArrayIterator $iterCurrentType */
|
/** @var \ArrayIterator $iterCurrentType */
|
||||||
$iterCurrentType = ($cheifLevel % 2 == 0)?$iterCandChiefStrength:$iterCandChiefIntel;
|
$iterCurrentType = ($chiefLevel % 2 == 0)?$iterCandChiefStrength:$iterCandChiefIntel;
|
||||||
$candidate = $iterCurrentType->current();
|
$candidate = $iterCurrentType->current();
|
||||||
|
|
||||||
while(key_exists($candidate, $promoted)){
|
while(key_exists($candidate, $promoted)){
|
||||||
@@ -1809,15 +1809,15 @@ class GeneralAI{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($candidate){
|
if($candidate){
|
||||||
$chiefCandidate[$cheifLevel] = $candidate;
|
$chiefCandidate[$chiefLevel] = $candidate;
|
||||||
$promoted[$candidate] = $cheifLevel;
|
$promoted[$candidate] = $chiefLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($chiefCandidate as $chiefLevel=>$chiefID){
|
foreach($chiefCandidate as $chiefLevel=>$chiefID){
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
'level'=>$cheifLevel
|
'level'=>$chiefLevel
|
||||||
], 'no=%i',$chiefID);
|
], 'no=%i',$chiefID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user