유저장 구출 버그 수정 예상
This commit is contained in:
+5
-12
@@ -694,19 +694,13 @@ class GeneralAI
|
|||||||
if(!$this->nation['capital']){
|
if(!$this->nation['capital']){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (in_array($this->dipState, [self::d평화, self::d선포])) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//고립 도시 장수 발령
|
//고립 도시 장수 발령
|
||||||
$args = [];
|
$args = [];
|
||||||
foreach ($this->lostGenerals as $lostGeneral) {
|
foreach ($this->lostGenerals as $lostGeneral) {
|
||||||
LogText('구출준비', "{$lostGeneral->getName()}");
|
|
||||||
if ($lostGeneral->getNPCType() >= 2) {
|
if ($lostGeneral->getNPCType() >= 2) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
LogText('구출준비1', "{$lostGeneral->getName()}");
|
|
||||||
|
|
||||||
if(
|
if(
|
||||||
$lostGeneral->getVar('crew') >= $this->nationPolicy->minWarCrew &&
|
$lostGeneral->getVar('crew') >= $this->nationPolicy->minWarCrew &&
|
||||||
$lostGeneral->getVar('train') >= $lostGeneral->getVar('defence_train') &&
|
$lostGeneral->getVar('train') >= $lostGeneral->getVar('defence_train') &&
|
||||||
@@ -716,8 +710,6 @@ class GeneralAI
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogText('구출준비2', "{$lostGeneral->getName()}");
|
|
||||||
|
|
||||||
$troopID = $lostGeneral->getVar('troop');
|
$troopID = $lostGeneral->getVar('troop');
|
||||||
if($troopID && key_exists($troopID, $this->troopLeaders)){
|
if($troopID && key_exists($troopID, $this->troopLeaders)){
|
||||||
$troopLeader = $this->troopLeaders[$troopID];
|
$troopLeader = $this->troopLeaders[$troopID];
|
||||||
@@ -730,7 +722,6 @@ class GeneralAI
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LogText('구출준비3', "{$lostGeneral->getName()}");
|
|
||||||
|
|
||||||
if (in_array($this->dipState, [self::d직전, self::d전쟁]) && count($this->frontCities) > 2) {
|
if (in_array($this->dipState, [self::d직전, self::d전쟁]) && count($this->frontCities) > 2) {
|
||||||
$selCity = Util::choiceRandom($this->frontCities);
|
$selCity = Util::choiceRandom($this->frontCities);
|
||||||
@@ -746,10 +737,12 @@ class GeneralAI
|
|||||||
if(!$args){
|
if(!$args){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
LogText('구출준비5', count($args));
|
|
||||||
$cmd = buildNationCommandClass('che_발령', $this->general, $this->env, $lastTurn, Util::choiceRandom($args));
|
$arg = Util::choiceRandom($args);
|
||||||
|
$cmd = buildNationCommandClass('che_발령', $this->general, $this->env, $lastTurn, $arg);
|
||||||
|
|
||||||
if(!$cmd->hasFullConditionMet()){
|
if(!$cmd->hasFullConditionMet()){
|
||||||
LogText('구출준비5', count($args));
|
LogText('구출실패', [$arg, $cmd->getFailString()]);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return $cmd;
|
return $cmd;
|
||||||
|
|||||||
Reference in New Issue
Block a user