From cd8ec0687fd7cf65875fe7a934aa675a2f4b5b5d Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 12 Apr 2018 04:16:02 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=B1=EB=B2=BD=20=EA=B3=B5=EA=B2=A9?= =?UTF-8?q?=EC=8B=9C=20'=EA=B5=AD=EA=B0=80'=EB=A5=BC=20=EA=B5=AC=ED=95=B4?= =?UTF-8?q?=EC=98=A4=EB=8A=94=20=EA=B3=BC=EC=A0=95=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EA=B3=B5=EB=B0=B1=EC=A7=80=EB=A5=BC=20=EA=B3=A0=EB=A0=A4?= =?UTF-8?q?=ED=95=98=EC=A7=80=20=EC=95=8A=EC=9D=80=20=EB=B6=80=EB=B6=84=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_history.php | 3 +++ hwe/process_war.php | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/hwe/func_history.php b/hwe/func_history.php index 81816221..cffd6b6a 100644 --- a/hwe/func_history.php +++ b/hwe/func_history.php @@ -129,6 +129,9 @@ function getBatLogRecent(int $no, int $count) { //DB-based function pushNationHistory($nation, $history) { + if(!$nation || !$nation['nation']){ + return; + } DB::db()->query("UPDATE nation set history=concat(%s, history) where nation=%i", $history.'
', $nation['nation']); } diff --git a/hwe/process_war.php b/hwe/process_war.php index c9b6f0ba..93881de1 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -86,7 +86,13 @@ function processWar($general, $city) { $query = "select nation,level,name,rice,capital,tech,type from nation where nation='{$city['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $destnation = MYDB_fetch_array($result); + $destnation = MYDB_fetch_array($result) ?: [ + 'nation'=>0, + 'level'=>0, + 'rice'=>2000, + 'type'=>0, + 'tech'=>0 + ]; //장수수 구함 $query = "select no from general where nation='{$general['nation']}'"; @@ -463,8 +469,12 @@ function processWar($general, $city) { // 죽은수 기술로 누적 $num = Util::round($mykillnum * 0.01); // 국가보정 - if($destnation['type'] == 3 || $destnation['type'] == 13) { $num *= 1.1; } - if($destnation['type'] == 5 || $destnation['type'] == 6 || $destnation['type'] == 7 || $destnation['type'] == 8 || $destnation['type'] == 12) { $num *= 0.9; } + if($destnation['type'] == 3 || $destnation['type'] == 13){ + $num *= 1.1; + } + if($destnation['type'] == 5 || $destnation['type'] == 6 || $destnation['type'] == 7 || $destnation['type'] == 8 || $destnation['type'] == 12) { + $num *= 0.9; + } // 부드러운 기술 제한 if(TechLimit($game['startyear'], $year, $destnation['tech'])) { $num = intdiv($num, 4); } $query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$destgencount' where nation='{$destnation['nation']}'";