From 39f4e89b03d0d3109993e10904d167ca79b07186 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 25 Dec 2023 08:05:34 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20HasRouteWithEnemy=EC=97=90=EC=84=9C=20"?= =?UTF-8?q?=EA=B5=90=EC=A0=84=20=EC=A4=91=EC=9D=B8=20=EA=B5=AD=EA=B0=80?= =?UTF-8?q?=EA=B0=80=20=EC=95=84=EB=8B=99=EB=8B=88=EB=8B=A4"=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20-=20=EA=B2=BD=EB=A1=9C=EC=97=90=20=EB=8F=84?= =?UTF-8?q?=EB=8B=AC=ED=95=A0=20=EB=B0=A9=EB=B2=95=EC=9D=B4=20=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EA=B2=83=EC=9D=80=20=EB=A7=9E=EC=9C=BC=EB=82=98..?= =?UTF-8?q?=20-=20=EA=B5=90=EC=A0=84=EC=A4=91=EC=9D=B4=20=EC=95=84?= =?UTF-8?q?=EB=8B=88=EB=9D=BC=EB=8A=94=20=EA=B2=83=EC=97=90=20=EC=9D=98?= =?UTF-8?q?=EB=AF=B8=EA=B0=80=20=EC=9E=88=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Constraint/HasRouteWithEnemy.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hwe/sammo/Constraint/HasRouteWithEnemy.php b/hwe/sammo/Constraint/HasRouteWithEnemy.php index 0b140039..a462ba22 100644 --- a/hwe/sammo/Constraint/HasRouteWithEnemy.php +++ b/hwe/sammo/Constraint/HasRouteWithEnemy.php @@ -35,6 +35,12 @@ class HasRouteWithEnemy extends Constraint{ $allowedNationList[] = $this->general['nation']; $allowedNationList[] = 0; + $destCityNation = $db->queryFirstField('SELECT nation FROM city WHERE city = %i', $this->destCity['city']); + if($destCityNation !== 0 && $destCityNation !== $this->general['nation'] && !in_array($destCityNation, $allowedNationList)){ + $this->reason = "교전중인 국가가 아닙니다."; + return false; + } + $distanceList = \sammo\searchDistanceListToDest($this->general['city'], $this->destCity['city'], $allowedNationList); if(!$distanceList){ $this->reason = "경로에 도달할 방법이 없습니다.";