diff --git a/hwe/func.php b/hwe/func.php index 318757a4..55c9ef55 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1619,9 +1619,8 @@ function checkTurn() { PreprocessCommand($general['no']); //if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processAI'); $reduce_turn = false; - if(($general['npc'] >= 2 || ($autorun_user['limit_minutes']??false)) && DecodeCommand($general['turn0'])[0] == 0) { - processAI($general['no']); - $reduce_turn = true; + if($general['npc'] >= 2 || ($autorun_user['limit_minutes']??false)) { + processAI($general['no'], $reduce_turn); } // npc AI 처리 //if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processCommand'); processCommand($general['no'], $reduce_turn); @@ -1739,11 +1738,9 @@ function checkTurn() { //if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', PreprocessCommand'); PreprocessCommand($general['no']); $reduce_turn = false; - //if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processAI'); - if($general['npc'] >= 2 || ($autorun_user['limit_minutes']??false)) { - processAI($general['no']); - $reduce_turn = true; - } // npc AI 처리 + if($general['npc'] >= 2 || ($autorun_user['limit_minutes']??false)) { + processAI($general['no'], $reduce_turn); + } //if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processCommand'); processCommand($general['no'], $reduce_turn); //if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateCommand'); diff --git a/hwe/func_npc.php b/hwe/func_npc.php index 0584fb2e..6452e236 100644 --- a/hwe/func_npc.php +++ b/hwe/func_npc.php @@ -260,7 +260,7 @@ function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $de return; } -function processAI($no) { +function processAI($no, &$reduce_turn) { $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); $connect=$db->get(); @@ -339,6 +339,8 @@ function processAI($no) { return; } + $reduce_turn = true; + $allowedAction = new AIAllowedAction($general['npc'], $autorun_user['options']??[]); $query = "select city,region,nation,level,path,rate,gen1,gen2,gen3,pop,supply,front from city where city='{$general['city']}'";