버그 수정
This commit is contained in:
+7
-18
@@ -3049,7 +3049,6 @@ class GeneralAI
|
|||||||
|
|
||||||
$month = $this->env['month'];
|
$month = $this->env['month'];
|
||||||
if($npcType >= 2 && $general->getVar('officer_level') == 12){
|
if($npcType >= 2 && $general->getVar('officer_level') == 12){
|
||||||
LogText('action', "Try Boss {$general->getID()}, {$general->getName()}");
|
|
||||||
if (in_array($month, [1, 4, 7, 10])) {
|
if (in_array($month, [1, 4, 7, 10])) {
|
||||||
$this->choosePromotion();
|
$this->choosePromotion();
|
||||||
} else if ($month == 12) {
|
} else if ($month == 12) {
|
||||||
@@ -3310,6 +3309,7 @@ class GeneralAI
|
|||||||
$randGeneral->applyDB($db);
|
$randGeneral->applyDB($db);
|
||||||
$this->nation["l{$chiefLevel}set"] = 1;
|
$this->nation["l{$chiefLevel}set"] = 1;
|
||||||
$setChiefLevel["l{$chiefLevel}set"] = 1;
|
$setChiefLevel["l{$chiefLevel}set"] = 1;
|
||||||
|
$this->chiefGenerals[$chiefLevel] = $randGeneral;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($setChiefLevel){
|
if($setChiefLevel){
|
||||||
@@ -3375,11 +3375,6 @@ class GeneralAI
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$nextChiefs[11] = $general;
|
$nextChiefs[11] = $general;
|
||||||
if(key_exists(11,$this->chiefGenerals)){
|
|
||||||
$oldChief = $this->chiefGenerals[11];
|
|
||||||
$oldChief->setVar('officer_level', 1);
|
|
||||||
$oldChief->setVar('officer_city', 0);
|
|
||||||
}
|
|
||||||
$general->setVar('officer_level', 11);
|
$general->setVar('officer_level', 11);
|
||||||
$general->setVar('officer_city', 0);
|
$general->setVar('officer_city', 0);
|
||||||
$nation['l11set'] = true;
|
$nation['l11set'] = true;
|
||||||
@@ -3449,25 +3444,19 @@ class GeneralAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
$nextChiefs[$chiefLevel] = $newChief;
|
$nextChiefs[$chiefLevel] = $newChief;
|
||||||
if(key_exists($chiefLevel,$this->chiefGenerals)){
|
|
||||||
$oldChief = $this->chiefGenerals[$chiefLevel];
|
|
||||||
$oldChief->setVar('officer_level', 1);
|
|
||||||
$oldChief->setVar('officer_city', 0);
|
|
||||||
}
|
|
||||||
$newChief->setVar('officer_level', $chiefLevel);
|
$newChief->setVar('officer_level', $chiefLevel);
|
||||||
$newChief->setVar('officer_city', 0);
|
$newChief->setVar('officer_city', 0);
|
||||||
$nation[$nationKey] = true;
|
$nation[$nationKey] = true;
|
||||||
$updatedNationVar[$nationKey] = 1;
|
$updatedNationVar[$nationKey] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach($this->chiefGenerals as $oldChief){
|
|
||||||
if($oldChief->getVar('officer_level') > 4){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$oldChief->applyDB($db);
|
|
||||||
}
|
|
||||||
foreach($nextChiefs as $chiefLevel=>$chief){
|
foreach($nextChiefs as $chiefLevel=>$chief){
|
||||||
|
$oldChief = $this->chiefGenerals[$chiefLevel]??null;
|
||||||
|
if($oldChief){
|
||||||
|
$oldChief->setVar('officer_level', 1);
|
||||||
|
$oldChief->setVar('officer_city', 0);
|
||||||
|
$oldChief->applyDB($db);
|
||||||
|
}
|
||||||
$chief->applyDB($db);
|
$chief->applyDB($db);
|
||||||
$this->chiefGenerals[$chiefLevel] = $chief;
|
$this->chiefGenerals[$chiefLevel] = $chief;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user