From ec1be2c88717588dcf86fbaa72c955f3951be8fb Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 17 Apr 2018 03:10:38 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=A9=EB=B3=91=20=ED=95=AD=EB=B3=B5=20?= =?UTF-8?q?=EC=95=88=EB=90=98=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/DiplomaticMessage.php | 6 +++--- hwe/sammo/Engine/Diplomacy.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hwe/sammo/DiplomaticMessage.php b/hwe/sammo/DiplomaticMessage.php index b4c59701..4a7f2c7a 100644 --- a/hwe/sammo/DiplomaticMessage.php +++ b/hwe/sammo/DiplomaticMessage.php @@ -139,7 +139,7 @@ class DiplomaticMessage extends Message{ protected function acceptMerge(){ $helper = new Engine\Diplomacy($this->src->nationID, $this->dest->nationID); - $chk = $helper->acceptMerge(); + $chk = $helper->acceptMerge($this->src->generalID, $this->dest->generalID); if($chk[0] !== self::ACCEPTED){ return $chk; } @@ -175,7 +175,7 @@ class DiplomaticMessage extends Message{ protected function acceptSurrender(){ $helper = new Engine\Diplomacy($this->src->nationID, $this->dest->nationID); - $chk = $helper->acceptSurrender(); + $chk = $helper->acceptSurrender($this->src->generalID, $this->dest->generalID); if($chk[0] !== self::ACCEPTED){ return $chk; } @@ -228,7 +228,7 @@ class DiplomaticMessage extends Message{ $this->dest->nationID ); - if(!$general){ + if($general){ $this->dest->generalID = $receiverID; $this->dest->generalName = $general['name']; } diff --git a/hwe/sammo/Engine/Diplomacy.php b/hwe/sammo/Engine/Diplomacy.php index 1ee28199..6ebb40d4 100644 --- a/hwe/sammo/Engine/Diplomacy.php +++ b/hwe/sammo/Engine/Diplomacy.php @@ -187,8 +187,8 @@ class Diplomacy{ $db = \sammo\DB::db(); - $states = $db->queryOneField( - 'SELECT `state` FROM diplomacy WHERE me = %i AND you != %i AND `state` NOT IN (2, 7) GROUP BY `state` ORDER BY `state`', + $states = $db->queryFirstColumn( + 'SELECT `state` FROM diplomacy WHERE `state` NOT IN (2, 7) AND me=%i AND you <>%i', $this->srcNation['nation'], $this->destNation['nation'] );