시나리오 생성시 잘못된 도시를 입력한 경우에도 정상 빌드되도록 수정
This commit is contained in:
@@ -76,7 +76,11 @@ class CityHelper{
|
||||
self::generateCache();
|
||||
}
|
||||
|
||||
return self::$listInv[$cityName];
|
||||
$city = self::$listInv[$cityName]??null;
|
||||
if($city === null){
|
||||
trigger_error("$cityName 에 해당하는 도시가 없습니다.");
|
||||
}
|
||||
return $city;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user