warning 수정

This commit is contained in:
2020-06-12 20:28:50 +09:00
parent c21c14825a
commit b6e307660f
3 changed files with 509 additions and 517 deletions
@@ -131,17 +131,9 @@ class che_인재탐색 extends Command\GeneralCommand
$nationID = $general->getNationID(); $nationID = $general->getNationID();
$nationCnt = count(getAllNationStaticInfo());
$totalGenCnt = $db->queryFirstField('SELECT count(no) FROM general WHERE npc <= 2'); $totalGenCnt = $db->queryFirstField('SELECT count(no) FROM general WHERE npc <= 2');
$totalNpcCnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4'); $totalNpcCnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4');
$genCnt = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc < 2', $nationID);
$npcCnt = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND 3 <= npc AND npc <= 4', $nationID);
$currCnt = Util::toInt($totalGenCnt + $totalNpcCnt / 2);
$avgCnt = $currCnt / $nationCnt;
$foundNpc = Util::randBool($this->calcFoundProp($env['maxgeneral'], $totalGenCnt, $totalNpcCnt)); $foundNpc = Util::randBool($this->calcFoundProp($env['maxgeneral'], $totalGenCnt, $totalNpcCnt));
$logger = $general->getLogger(); $logger = $general->getLogger();
+2 -2
View File
@@ -534,7 +534,7 @@ class GeneralAI
if(!key_exists($userGeneral->getCityID(), $this->nationCities)){ if(!key_exists($userGeneral->getCityID(), $this->nationCities)){
continue; continue;
} }
$city = $this->supplyCities[$userGeneral->getCityID()]; $city = $this->nationCities[$userGeneral->getCityID()];
$troopLeaderID = $userGeneral->getVar('troop'); $troopLeaderID = $userGeneral->getVar('troop');
if(!$troopLeaderID || !key_exists($troopLeaderID, $this->troopLeaders)){ if(!$troopLeaderID || !key_exists($troopLeaderID, $this->troopLeaders)){
continue; continue;
@@ -2778,7 +2778,7 @@ class GeneralAI
if($city['city'] === $candidate['city']){ if($city['city'] === $candidate['city']){
continue; continue;
} }
$realDevelRate = 0; $realDevelRate = 0.0001; //하단의 나눗셈
foreach($this->calcCityDevelRate($candidate) as $develKey => [$develVal, $develType]){ foreach($this->calcCityDevelRate($candidate) as $develKey => [$develVal, $develType]){
if(!($this->genType & $develType)){ if(!($this->genType & $develType)){