방랑군이라 도시가 0일때 발생하는 문제 해결
This commit is contained in:
@@ -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>";
|
$nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation['color']).";background-color:{$nation['color']};>{$nation['name']}</font><br>";
|
||||||
$powerStr .= "국력 {$nation['power']}<br>";
|
$powerStr .= "국력 {$nation['power']}<br>";
|
||||||
$genStr .= "장수 {$nation['gennum']}<br>";
|
$genStr .= "장수 {$nation['gennum']}<br>";
|
||||||
$cityStr .= "속령 $citycount<br>";
|
$cityStr .= "속령 $cityCount<br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', contents collected');
|
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', contents collected');
|
||||||
|
|||||||
@@ -57,7 +57,13 @@ class Nation{
|
|||||||
$cities = array_map(function($cityName){
|
$cities = array_map(function($cityName){
|
||||||
return \sammo\CityHelper::getCityByName($cityName)['id'];
|
return \sammo\CityHelper::getCityByName($cityName)['id'];
|
||||||
}, $this->cities);
|
}, $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);
|
$type = \sammo\NationCharCall($this->type);
|
||||||
|
|
||||||
@@ -85,9 +91,12 @@ class Nation{
|
|||||||
'type'=>$type,
|
'type'=>$type,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$db->update('city', [
|
if($cities){
|
||||||
'nation'=>$this->id
|
$db->update('city', [
|
||||||
], 'city IN %li', $cities);
|
'nation'=>$this->id
|
||||||
|
], 'city IN %li', $cities);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$diplomacy = [];
|
$diplomacy = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user