$sorted
);
+ $competitors = array();
+
/* Leader and runner-up. */
foreach ($entries as $entry) {
if (endorsement('x', $entry->getEndorsements())) continue;
$entry_id = $entry->getId();
if (in_array($entry_id, array_values($ret))) continue;
+ $competitor_id = $entry->getShip()->getCompetitor()->getId();
+ if (in_array($competitor_id, $competitors)) continue;
+ $competitors[] = $competitor_id;
if (is_null($ret['leader'])) $ret['leader'] = $entry_id;
else if (is_null($ret['runnerup'])) {
$ret['runnerup'] = $entry_id;