From d46b3154cc0106e2e703e8e37254f158a09c0ce5 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 21 Apr 2019 16:06:27 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_command.php | 2 +- hwe/sammo/Command/Nation/che_발령.php | 1 + hwe/sammo/GeneralAI.php | 5 +++-- hwe/sammo/Scenario/Nation.php | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hwe/func_command.php b/hwe/func_command.php index b161a75e..03633271 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -123,7 +123,7 @@ function pullNationCommand(int $nationID, int $level, int $turnCnt=1){ 'action'=>'휴식', 'arg'=>'{}' ], 'nation_id=%i AND level=%i AND turn_idx < %i', $nationID, $level, $turnCnt); - $db->update('general_turn', [ + $db->update('nation_turn', [ 'turn_idx'=>$db->sqleval('turn_idx - %i', $turnCnt) ], 'nation_id=%i AND level=%i', $nationID, $level); } diff --git a/hwe/sammo/Command/Nation/che_발령.php b/hwe/sammo/Command/Nation/che_발령.php index 448cb4c9..2ae08558 100644 --- a/hwe/sammo/Command/Nation/che_발령.php +++ b/hwe/sammo/Command/Nation/che_발령.php @@ -8,6 +8,7 @@ use \sammo\{ GameConst, LastTurn, GameUnitConst, + CityConst, Command }; diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index 803ce154..e34f0a23 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -1735,6 +1735,7 @@ class GeneralAI{ while(key_exists($candidate, $promoted)){ $iterCurrentType->next(); + $candidate = $iterCurrentType->current(); } $chiefCandidate[$cheifLevel] = $candidate; @@ -1779,7 +1780,7 @@ class GeneralAI{ $db->update('nation', [ 'war'=>0, 'rate'=>$rate - ]); + ], 'nation=%i', $nationID); return $rate; } } @@ -1806,7 +1807,7 @@ class GeneralAI{ return $bill; } - protected function caclRiceBillRate():int{ + protected function calcRiceBillRate():int{ $db = DB::db(); $nation = $this->nation; $env = $this->env; diff --git a/hwe/sammo/Scenario/Nation.php b/hwe/sammo/Scenario/Nation.php index de862e96..4d764f49 100644 --- a/hwe/sammo/Scenario/Nation.php +++ b/hwe/sammo/Scenario/Nation.php @@ -153,15 +153,15 @@ class Nation{ foreach(range(getNationChiefLevel(0) - 1, getNationChiefLevel($this->nationLevel), -1) as $chiefLevel){ foreach(range(0, GameConst::$maxChiefTurn - 1) as $turnIdx){ $turnRows[] = [ - 'nation_id'=>$nation['nation'], + 'nation_id'=>$this->id, 'level'=>$chiefLevel, 'turn_idx'=>$turnIdx, 'action'=>'휴식', - 'arg'=>null, + 'arg'=>'{}', ]; } } - $db->insertIgnore('nation_turn', $turnRows); + $db->insert('nation_turn', $turnRows); } public function getBrief(){