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