fix: NPC국 생성 시, 평균 기술력을 받아오지 못하는 문제 수정
This commit is contained in:
@@ -129,15 +129,7 @@ class RaiseNPCNation extends \sammo\Event\Action
|
||||
|
||||
public function calcAvgTech(): int
|
||||
{
|
||||
$techSum = 0;
|
||||
$nationCnt = 0;
|
||||
foreach (\sammo\getAllNationStaticInfo() as $nation) {
|
||||
if ($nation['level'] == 0) {
|
||||
continue;
|
||||
}
|
||||
$techSum += $nation['tech'];
|
||||
$nationCnt += 1;
|
||||
}
|
||||
[$techSum, $nationCnt] = DB::db()->queryFirstList('SELECT sum(tech), COUNT(tech) FROM nation WHERE level > 0') ?? [0, 0];
|
||||
if ($nationCnt == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user