버그 수정

This commit is contained in:
2020-04-22 03:18:01 +09:00
parent 0b825f58cf
commit 8f438f95d0
2 changed files with 20 additions and 28 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ class AutorunGeneralPolicy{
public $can상인무시 = true; public $can상인무시 = true;
public $can징병 = true; public $can징병 = true;
public $can모병 = true; public $can모병 = false;
public $can한계징병 = true; public $can한계징병 = true;
public $can고급병종 = true; public $can고급병종 = true;
public $can전투준비 = true; public $can전투준비 = true;
+19 -27
View File
@@ -1109,22 +1109,17 @@ class GeneralAI
return null; return null;
} }
if($this->nation['gold'] < $this->nationPolicy->reqNationGold){
return null;
}
if($this->nation['rice'] < $this->nationPolicy->reqNationRice){
return null;
}
$nation = $this->nation; $nation = $this->nation;
$candidateArgs = []; $candidateArgs = [];
$remainResource = [ $remainResource = [
'gold' => [ 'gold' => [
$this->nationPolicy->reqNationGold,
$nation['gold'], $nation['gold'],
$this->nationPolicy->reqHumanWarRecommandGold, $this->nationPolicy->reqHumanWarRecommandGold,
$this->nationPolicy->reqHumanDevelGold, $this->nationPolicy->reqHumanDevelGold,
], ],
'rice' => [ 'rice' => [
$this->nationPolicy->reqNationRice,
$nation['rice'], $nation['rice'],
$this->nationPolicy->reqHumanWarRecommandRice, $this->nationPolicy->reqHumanWarRecommandRice,
$this->nationPolicy->reqHumanDevelRice $this->nationPolicy->reqHumanDevelRice
@@ -1135,7 +1130,10 @@ class GeneralAI
$userGenerals = $this->userGenerals; $userGenerals = $this->userGenerals;
foreach($remainResource as $resName=>[$resVal,$reqHumanMinWarRes,$reqHumanMinDevelRes]){ foreach($remainResource as $resName=>[$reqNationRes, $resVal,$reqHumanMinWarRes,$reqHumanMinDevelRes]){
if($resVal < $reqNationRes){
continue;
}
usort($userGenerals, function ($lhs, $rhs) use ($resName) { usort($userGenerals, function ($lhs, $rhs) use ($resName) {
return $lhs->getVar($resName) <=> $rhs->getVar($resName); return $lhs->getVar($resName) <=> $rhs->getVar($resName);
}); });
@@ -1210,22 +1208,16 @@ class GeneralAI
return null; return null;
} }
if($this->nation['gold'] < $this->nationPolicy->reqNationGold){
return null;
}
if($this->nation['rice'] < $this->nationPolicy->reqNationRice){
return null;
}
$nation = $this->nation; $nation = $this->nation;
$candidateArgs = []; $candidateArgs = [];
$remainResource = [ $remainResource = [
'gold' => [ 'gold' => [
$this->nationPolicy->reqNationGold,
$nation['gold'], $nation['gold'],
$this->nationPolicy->reqNPCWarGold $this->nationPolicy->reqNPCWarGold
], ],
'rice' => [ 'rice' => [
$this->nationPolicy->reqNationRice,
$nation['rice'], $nation['rice'],
$this->nationPolicy->reqNPCWarRice $this->nationPolicy->reqNPCWarRice
] ]
@@ -1234,7 +1226,10 @@ class GeneralAI
$npcWarGenerals = $this->npcWarGenerals; $npcWarGenerals = $this->npcWarGenerals;
foreach($remainResource as $resName=>[$resVal,$reqNPCMinWarRes]){ foreach($remainResource as $resName=>[$reqNationRes, $resVal,$reqNPCMinWarRes]){
if($resVal < $reqNationRes){
continue;
}
usort($npcWarGenerals, function ($lhs, $rhs) use ($resName) { usort($npcWarGenerals, function ($lhs, $rhs) use ($resName) {
return $lhs->getVar($resName) <=> $rhs->getVar($resName); return $lhs->getVar($resName) <=> $rhs->getVar($resName);
}); });
@@ -1296,23 +1291,17 @@ class GeneralAI
return null; return null;
} }
if($this->nation['gold'] < $this->nationPolicy->reqNationGold){
return null;
}
if($this->nation['rice'] < $this->nationPolicy->reqNationRice){
return null;
}
$nation = $this->nation; $nation = $this->nation;
$candidateArgs = []; $candidateArgs = [];
$remainResource = [ $remainResource = [
'gold' => [ 'gold' => [
$this->nationPolicy->reqNationGold,
$nation['gold'], $nation['gold'],
$this->nationPolicy->reqNPCWarGold, $this->nationPolicy->reqNPCWarGold,
$this->nationPolicy->reqNPCDevelGold $this->nationPolicy->reqNPCDevelGold
], ],
'rice' => [ 'rice' => [
$this->nationPolicy->reqNationRice,
$nation['rice'], $nation['rice'],
$this->nationPolicy->reqNPCWarRice, $this->nationPolicy->reqNPCWarRice,
$this->nationPolicy->reqNPCDevelRice $this->nationPolicy->reqNPCDevelRice
@@ -1323,7 +1312,10 @@ class GeneralAI
$npcWarGenerals = $this->npcWarGenerals; $npcWarGenerals = $this->npcWarGenerals;
$npcCivilGenerals = $this->npcCivilGenerals; $npcCivilGenerals = $this->npcCivilGenerals;
foreach($remainResource as $resName=>[$resVal,$reqNPCMinWarRes,$reqNPCMinDevelRes]){ foreach($remainResource as $resName=>[$reqNationRes, $resVal,$reqNPCMinWarRes,$reqNPCMinDevelRes]){
if($resVal < $reqNationRes){
continue;
}
usort($npcWarGenerals, function ($lhs, $rhs) use ($resName) { usort($npcWarGenerals, function ($lhs, $rhs) use ($resName) {
return $lhs->getVar($resName) <=> $rhs->getVar($resName); return $lhs->getVar($resName) <=> $rhs->getVar($resName);
}); });
@@ -2820,7 +2812,7 @@ class GeneralAI
if($nation['gold'] < $this->nationPolicy->reqNationGold){ if($nation['gold'] < $this->nationPolicy->reqNationGold){
$candidate[] = 'che_물자조달'; $candidate[] = 'che_물자조달';
} }
if($nation['rice'] < $this->nationPolicy->reqNationGold){ if($nation['rice'] < $this->nationPolicy->reqNationRice){
$candidate[] = 'che_물자조달'; $candidate[] = 'che_물자조달';
} }
$candidate[] = 'che_인재탐색'; $candidate[] = 'che_인재탐색';