방랑군이라 도시가 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
+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 = [];