From 20c2d96dee030278764b7db3eec1ce3d275eaf05 Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 22 Apr 2020 23:18:50 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/GeneralAI.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index e7da3138..c354c8ce 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -651,7 +651,7 @@ class GeneralAI $selCity = Util::choiceRandom($this->supplyCities); } //고립된 장수가 많을 수록 발령 확률 증가 - $args = [ + $args[] = [ 'destGeneralID' => $lostGeneral->getID(), 'destCityID' => $selCity['city'] ]; @@ -814,10 +814,10 @@ class GeneralAI if($generalID == $this->general->getID()){ continue; } - $city = $this->supplyCities[$npcGeneral->getCityID()]; - if(!key_exists($generalID, $this->supplyCities)){ + if(!key_exists($npcGeneral->getCityID(), $this->supplyCities)){ continue; } + $city = $this->supplyCities[$npcGeneral->getCityID()]; if($npcGeneral->getVar('troop') !== 0){ continue; } @@ -884,7 +884,7 @@ class GeneralAI } $selCity = Util::choiceRandom($this->supplyCities); //고립된 장수가 많을 수록 발령 확률 증가 - $args = [ + $args[] = [ 'destGeneralID' => $lostGeneral->getID(), 'destCityID' => $selCity['city'] ]; @@ -2262,6 +2262,9 @@ class GeneralAI } $attackableNations[] = $targetNationID; } + if(!$attackableNations){ + $attackableNations[] = 0; + } $nearCities = array_keys(CityConst::byID($cityID)->path); $attackableCities = $db->queryFirstColumn(