방랑군이라 도시가 0일때 발생하는 문제 해결

This commit is contained in:
2018-04-01 22:48:22 +09:00
parent 4fab99b946
commit 117643f592
2 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -270,7 +270,7 @@ function LogHistory($isFirst=0) {
$nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation['color']).";background-color:{$nation['color']};>{$nation['name']}</font><br>";
$powerStr .= "국력 {$nation['power']}<br>";
$genStr .= "장수 {$nation['gennum']}<br>";
$cityStr .= "속령 $citycount<br>";
$cityStr .= "속령 $cityCount<br>";
}
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', contents collected');
+13 -4
View File
@@ -57,7 +57,13 @@ class Nation{
$cities = array_map(function($cityName){
return \sammo\CityHelper::getCityByName($cityName)['id'];
}, $this->cities);
$capital = \sammo\CityHelper::getCityByName($this->capital)['id'];
if($this->capital){
$capital = \sammo\CityHelper::getCityByName($this->capital)['id'];
}
else{
$capital = 0;
}
$type = \sammo\NationCharCall($this->type);
@@ -85,9 +91,12 @@ class Nation{
'type'=>$type,
]);
$db->update('city', [
'nation'=>$this->id
], 'city IN %li', $cities);
if($cities){
$db->update('city', [
'nation'=>$this->id
], 'city IN %li', $cities);
}
$diplomacy = [];