From 75934fc5ae23a04827a1fcdb378cdd8a1d2f1615 Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 1 May 2020 16:02:36 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=A0=EC=96=91=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 5 +++-- hwe/sammo/General.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hwe/func.php b/hwe/func.php index ffc226c7..154157dd 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1634,7 +1634,8 @@ function nextRuler(General $general) { //npc or npc유저인 경우 후계 찾기 if($general->getVar('npc') > 0) { $candidate = $db->queryFirstRow( - 'SELECT no,name,nation,officer_level,IF(ABS(affinity-%i)>75,150-ABS(affinity-%i),ABS(affinity-%i)) as npcmatch2 from general where nation=%i and officer_level!=12 and npc>0 order by npcmatch2,rand() LIMIT 1', + 'SELECT no,name,officer_level,IF(ABS(affinity-%i)>75,150-ABS(affinity-%i),ABS(affinity-%i)) as npcmatch2 from general where nation=%i and officer_level!=12 and npc>0 order by npcmatch2,rand() LIMIT 1', + $general->getVar('affinity'), $general->getVar('affinity'), $general->getVar('affinity'), $nationID @@ -1669,7 +1670,7 @@ function nextRuler(General $general) { $db->update('general', [ 'officer_level'=>12, 'officer_city'=>0, - ], 'no=%i', $nextRulerID); + ], 'no=%i AND nation=%i', $nextRulerID, $nationID); if($db->affectedRows()==0){ throw new \RuntimeException('선양되지 않음'); } diff --git a/hwe/sammo/General.php b/hwe/sammo/General.php index cd0a5939..f4b4cb02 100644 --- a/hwe/sammo/General.php +++ b/hwe/sammo/General.php @@ -534,6 +534,7 @@ class General implements iAction{ $officerLevel = $this->getVar('officer_level'); if($officerLevel == 12) { nextRuler($this); + $this->setVar('officer_level', 1); } // 부대 처리