flip for consistency
@@ -676,8 +676,8 @@ if ($method === 'POST') {
676
676
$tribe = Tribe::load($userId, $saveId);
677
677
678
678
// Get kobolds with full stats, items and injuries
679
$kobolds = getKobolds($tribe, true);
680
$rivals = getKobolds($tribe, false);
679
$kobolds = getKobolds($tribe, false);
680
$rivals = getKobolds($tribe, true);
681
681
682
682
// Get storage items
683
683
$storage = $tribe->getStorage();
@@ -758,10 +758,10 @@ if ($method === 'POST') {
758
758
}
759
759
}
760
760
761
function getKobolds($tribe, $tribeMembers): array
761
function getKobolds($tribe, $getRivals): array
762
762
{
763
763
$kobolds = [];
764
foreach ($tribe->getKobolds(!$tribeMembers) as $kobold) {
764
foreach ($tribe->getKobolds($getRivals === true) as $kobold) {
765
765
$kInjuries = $kobold->getInjuries() ?? [];
766
766
// enrich injuries with required medicine mapping
767
767
foreach ($kInjuries as &$inj) {
@@ -676,8 +676,8 @@ if ($method === 'POST') {676
$tribe = Tribe::load($userId, $saveId);676
$tribe = Tribe::load($userId, $saveId);677
677
678
// Get kobolds with full stats, items and injuries678
// Get kobolds with full stats, items and injuries679
$kobolds = getKobolds($tribe, true);679
$kobolds = getKobolds($tribe, false);680
$rivals = getKobolds($tribe, false);680
$rivals = getKobolds($tribe, true);681
681
682
// Get storage items682
// Get storage items683
$storage = $tribe->getStorage();683
$storage = $tribe->getStorage();@@ -758,10 +758,10 @@ if ($method === 'POST') {758
}758
}759
}759
}760
760
761
function getKobolds($tribe, $tribeMembers): array761
function getKobolds($tribe, $getRivals): array762
{762
{763
$kobolds = [];763
$kobolds = [];764
foreach ($tribe->getKobolds(!$tribeMembers) as $kobold) {764
foreach ($tribe->getKobolds($getRivals === true) as $kobold) {765
$kInjuries = $kobold->getInjuries() ?? [];765
$kInjuries = $kobold->getInjuries() ?? [];766
// enrich injuries with required medicine mapping766
// enrich injuries with required medicine mapping767
foreach ($kInjuries as &$inj) {767
foreach ($kInjuries as &$inj) {