diff --git a/hwe/func.php b/hwe/func.php index 026c4b69..5dd26c7e 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1734,7 +1734,7 @@ function deleteNation(General $lord, bool $applyDB): array $nationGeneralList = General::createObjListFromDB( $db->queryFirstColumn( - 'SELECT `no` FROM general WHERE nation=%i AND no != %i', + 'SELECT `no` FROM general WHERE nation=%i AND no != %i ORDER BY no ASC', $nationID, $lordID ), diff --git a/hwe/process_war.php b/hwe/process_war.php index c7c84701..6947f3e6 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -37,7 +37,7 @@ function processWar(string $warSeed, General $attackerGeneral, array $rawAttacke $city = new WarUnitCity($rng, $rawDefenderCity, $rawDefenderNation, $year, $month, $startYear); - $defenderCityGeneralIDList = $db->queryFirstColumn('SELECT no FROM general WHERE nation=%i AND city=%i AND nation!=0', $city->getVar('nation'), $city->getVar('city')); + $defenderCityGeneralIDList = $db->queryFirstColumn('SELECT no FROM general WHERE nation=%i AND city=%i AND nation!=0 ORDER BY no', $city->getVar('nation'), $city->getVar('city')); $defenderCityGeneralList = General::createObjListFromDB($defenderCityGeneralIDList, null); /** @var WarUnit[] */