From 9831685bb9db9099f2f6a4ec7b8a16e82ec35227 Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 10 Apr 2018 21:11:56 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=91=EC=A2=85=20=EA=B0=80=EA=B2=A9=20?= =?UTF-8?q?=EA=B3=84=EC=82=B0=20=EB=B2=84=EA=B7=B8,=20=EC=A0=91=EA=B2=BD?= =?UTF-8?q?=20=EA=B3=84=EC=82=B0=20=EB=B2=84=EA=B7=B8,=20=EA=B8=B4?= =?UTF-8?q?=EA=B8=89=20=EC=B2=9C=EB=8F=84=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/func_converter.php | 3 ++- hwe/func_gamerule.php | 2 +- hwe/process_war.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hwe/func_converter.php b/hwe/func_converter.php index 6286082d..b7c765fc 100644 --- a/hwe/func_converter.php +++ b/hwe/func_converter.php @@ -398,7 +398,8 @@ function getBill(int $dedication) : int{ function getCost(int $armtype) : int { //FIXME: 정말로 side effect가 없으려면 query는 밖으로 이동해야함. //TODO: 병종 값이 column으로 들어있는건 전혀 옳지 않음. key->value 형태로 바꿔야함 - return DB::db()->queryFirstColumn('select %b from game limit 1', sprintf('cst%d', $armtype)); + + return GameUnitConst::byID($armtype)->cost; } function TechLimit($startyear, $year, $tech) : int { diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index 12820c90..5a6a94ab 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -237,7 +237,7 @@ function SetNationFront($nationNo) { if($adj){ $db->update('city', [ - 'front'=>0 + 'front'=>1 ], 'nation=%i and city in %li', $nationNo, array_keys($adj)); } } diff --git a/hwe/process_war.php b/hwe/process_war.php index 770581dd..7a7df738 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -1862,7 +1862,7 @@ function ConquerCity($game, $general, $city, $nation, $destnation) { $cities = []; foreach( DB::db()->query( - 'SELECT city, pop FROM city WHERE nation=%i and city!=%i', + 'SELECT nation, city, pop FROM city WHERE nation=%i and city!=%i', $destnation['nation'], $city['city'] ) as $row