diff --git a/hwe/sammo/Scenario/Nation.php b/hwe/sammo/Scenario/Nation.php index 5c8c3b6e..cbcc0f5a 100644 --- a/hwe/sammo/Scenario/Nation.php +++ b/hwe/sammo/Scenario/Nation.php @@ -139,9 +139,9 @@ class Nation{ ], 'nation=%i', $this->id); //군주가 없는지 확인 - $hasRuler = $db->queryFirstField('SELECT count(*) FROM general WHERE nation=%i AND level=12'); + $hasRuler = $db->queryFirstField('SELECT count(*) FROM general WHERE nation=%i AND level=12', $this->id); if(!$hasRuler){ - $newRuler = $db->queryFirstField('SELECT `no` FROM general WHERE nation=1 ORDER BY leader+power+intel DESC LIMIT 1'); + $newRuler = $db->queryFirstField('SELECT `no` FROM general WHERE nation=%i ORDER BY leader+power+intel DESC LIMIT 1', $this->id); $db->update('general',['level'=>12], 'no=%i', $newRuler); } }