fix: 진행 중 $rng 호출 관련 버그 수정

This commit was merged in pull request #219.
This commit is contained in:
2022-05-17 23:28:31 +09:00
parent 9efe7ba171
commit 07f2042d42
5 changed files with 7 additions and 9 deletions
+3 -1
View File
@@ -1247,7 +1247,7 @@ function updateOnline()
$gameStor->online_nation = join(', ', $onlineNation);
}
function addAge()
function addAge(RandUtil $rng)
{
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
@@ -1268,6 +1268,7 @@ function addAge()
foreach ($db->query('SELECT no,name,nation,leadership,strength,intel,aux from general where specage<=age and special=%s', GameConst::$defaultSpecialDomestic) as $general) {
$generalID = $general['no'];
$special = SpecialityHelper::pickSpecialDomestic(
$rng,
$general,
(Json::decode($general['aux'])['prev_types_special']) ?? []
);
@@ -1295,6 +1296,7 @@ function addAge()
$updateVars['aux'] = Json::encode($generalAux);
} else {
$special2 = SpecialityHelper::pickSpecialWar(
$rng,
$general,
($generalAux['prev_types_special2']) ?? []
);