fix: 국가가 하나도 없을 땐 CreateManyNPC가 동작하지 않아야 함

This commit is contained in:
2023-03-16 00:07:04 +09:00
parent 49b39c34eb
commit ab2e43e8dd
+3 -1
View File
@@ -70,7 +70,9 @@ class CreateManyNPC extends \sammo\Event\Action
if ($this->fillCnt) {
$db = DB::db();
$nations = $db->queryFirstColumn('SELECT nation FROM general WHERE npc < 3 AND officer_level = 12');
$regGens = $db->queryFirstField('SELECT count(*) FROM general WHERE nation IN %li AND npc < 4', $nations);
if($nations){
$regGens = $db->queryFirstField('SELECT count(*) FROM general WHERE nation IN %li AND npc < 4', $nations);
}
$moreGenCnt = count($nations) * $this->fillCnt - $regGens;
}