NPC 부대 생성 버그 수정
This commit is contained in:
@@ -960,7 +960,7 @@ function updateNationState() {
|
|||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
$history = array();
|
$history = array();
|
||||||
$admin = $gameStor->getValues(['year', 'month']);
|
$admin = $gameStor->getValues(['year', 'month', 'fiction', 'startyear', 'show_img_level', 'turnterm']);
|
||||||
|
|
||||||
$query = "select nation,name,level from nation";
|
$query = "select nation,name,level from nation";
|
||||||
$nationresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$nationresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -996,6 +996,7 @@ function updateNationState() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($nationlevel > $nation['level']) {
|
if($nationlevel > $nation['level']) {
|
||||||
|
$oldLevel = $nation['level'];
|
||||||
$nation['level'] = $nationlevel;
|
$nation['level'] = $nationlevel;
|
||||||
|
|
||||||
switch($nationlevel) {
|
switch($nationlevel) {
|
||||||
@@ -1022,7 +1023,7 @@ function updateNationState() {
|
|||||||
|
|
||||||
|
|
||||||
$lastAssemblerID = $gameStor->assemblerID??0;
|
$lastAssemblerID = $gameStor->assemblerID??0;
|
||||||
$jumpStep = $nationLevel - max(1, $nation['level']);
|
$jumpStep = $nationlevel - max(1, $oldLevel);
|
||||||
if($jumpStep > 0){
|
if($jumpStep > 0){
|
||||||
foreach(range(1, $jumpStep) as $levelGen){
|
foreach(range(1, $jumpStep) as $levelGen){
|
||||||
$lastAssemblerID += 1;
|
$lastAssemblerID += 1;
|
||||||
@@ -1032,7 +1033,7 @@ function updateNationState() {
|
|||||||
10, 10, 10, 1, $admin['year'] - 15, $admin['year'] + 15, 10, 75
|
10, 10, 10, 1, $admin['year'] - 15, $admin['year'] + 15, 10, 75
|
||||||
);
|
);
|
||||||
$npcObj->npc = 5;
|
$npcObj->npc = 5;
|
||||||
$npcObj->build();
|
$npcObj->build($admin);
|
||||||
$npcID = $npcObj->generalID;
|
$npcID = $npcObj->generalID;
|
||||||
|
|
||||||
$db->insert('troop', [
|
$db->insert('troop', [
|
||||||
@@ -1056,7 +1057,7 @@ function updateNationState() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$gameStor->assemberlID = $lastAssemblerID;
|
$gameStor->assemblerlID = $lastAssemblerID;
|
||||||
|
|
||||||
//작위 상승
|
//작위 상승
|
||||||
$query = "update nation set level='{$nation['level']}' where nation='{$nation['nation']}'";
|
$query = "update nation set level='{$nation['level']}' where nation='{$nation['nation']}'";
|
||||||
|
|||||||
@@ -1279,6 +1279,9 @@ function NPCStaffWork($general, $nation, $dipState){
|
|||||||
if($generalCity['pop'] - 33000 > $nationGeneral['leader']){
|
if($generalCity['pop'] - 33000 > $nationGeneral['leader']){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if($nationGeneral['npc'] == 5){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$score = 5;
|
$score = 5;
|
||||||
if($nationGeneral['npc']<2){
|
if($nationGeneral['npc']<2){
|
||||||
|
|||||||
Reference in New Issue
Block a user