시나리오 생성시 잘못된 도시를 입력한 경우에도 정상 빌드되도록 수정

This commit is contained in:
Hide_D committed 2018-06-18 02:23:30 +09:00
1 parent e2a1203b43
commit acb09bfe71
3 files changed
+11 -6

No files matched your search

+4 -3
View File
@@ -177,6 +177,9 @@ class NPC{
}
$city = $this->locatedCity;
if($city !== null){
$city = CityHelper::getCityByName($city)['id']??null;
}
if($city === null){
if($nationID == 0 || !CityHelper::getAllNationCities($nationID)){
$cityObj = Util::choiceRandom(CityHelper::getAllCities());
@@ -187,9 +190,7 @@ class NPC{
'@phan-var array<string,string|int> $cityObj';
$city = $cityObj['id'];
}
else{
$city = CityHelper::getCityByName($city)['id'];
}
$experience = $age * 100;
$dedication = $age * 100;