From 3b70cbe724b3768ceebcf327a96f20164762d7bb Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sun, 2 Oct 2022 17:46:20 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20GeneralAI=20env=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=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/sammo/GeneralAI.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index dbf45e23..7923fdb0 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -89,8 +89,6 @@ class GeneralAI $this->reqUpdateInstance = false; $db = DB::db(); - $gameStor = KVStorage::getStorage($db, 'game_env'); - $this->env = $gameStor->getAll(true); $this->baseDevelCost = $this->env['develcost'] * 12; $general = $this->general; $city = $general->getRawCity(); @@ -119,8 +117,8 @@ class GeneralAI $nationStor = KVStorage::getStorage($db, $this->nation['nation'], 'nation_env'); $nationStor->cacheValues(['npc_nation_policy', 'npc_general_policy', 'prev_income_gold', 'prev_income_rice']); - $this->nationPolicy = new AutorunNationPolicy($general, $this->env['autorun_user']['options'] ?? null, $nationStor->getValue('npc_nation_policy'), $gameStor->getValue('npc_nation_policy'), $this->nation, $this->env); - $this->generalPolicy = new AutorunGeneralPolicy($general, $this->env['autorun_user']['options'] ?? null, $nationStor->getValue('npc_general_policy'), $gameStor->getValue('npc_general_policy'), $this->nation, $this->env); + $this->nationPolicy = new AutorunNationPolicy($general, $this->env['autorun_user']['options'] ?? null, $nationStor->getValue('npc_nation_policy'), $this->env['npc_nation_policy'], $this->nation, $this->env); + $this->generalPolicy = new AutorunGeneralPolicy($general, $this->env['autorun_user']['options'] ?? null, $nationStor->getValue('npc_general_policy'), $this->env['npc_general_policy'], $this->nation, $this->env); $prevIncomeGold = $nationStor->prev_income_gold ?? 1000; $prevIncomeRice = $nationStor->prev_income_rice ?? 1000; @@ -143,6 +141,10 @@ class GeneralAI public function __construct(protected General $general) { + $db = DB::db(); + $gameStor = KVStorage::getStorage($db, 'game_env'); + $this->env = $gameStor->getAll(true); + $this->rng = new RandUtil(new LiteHashDRBG(Util::simpleSerialize( UniqueConst::$hiddenSeed, 'GeneralAI',