Skip to content

Commit

Permalink
dont count legacy achievements
Browse files Browse the repository at this point in the history
  • Loading branch information
Plancke committed May 8, 2019
1 parent c159bea commit eb50b88
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/responses/player/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,13 @@ public function getAchievementPoints($force_update = false) {
$oneTime = $this->getArray('achievementsOneTime');
$this->getHypixelPHP()->getLogger()->log('Starting OneTime Achievements');
foreach ($oneTime as $dbName) {
if (!is_string($dbName)) {
continue;
}
if (!is_string($dbName)) continue;
$game = strtolower(substr($dbName, 0, strpos($dbName, "_")));
$dbName = strtoupper(substr($dbName, strpos($dbName, "_") + 1));
if (!in_array($game, $games)) {
continue;
}
if (!in_array($game, $games)) continue;
$this->getHypixelPHP()->getLogger()->log('Achievement: ' . strtoupper(substr($dbName, strpos($dbName, "_"))));
if (in_array($dbName, array_keys($achievements[$game]['one_time']))) {
if (array_key_exists("legacy", $achievements[$game]['one_time'][$dbName]) && $achievements[$game]['one_time'][$dbName]["legacy"]) continue;
$this->getHypixelPHP()->getLogger()->log('Achievement: ' . $dbName . ' - ' . $achievements[$game]['one_time'][$dbName]['points']);
$total += $achievements[$game]['one_time'][$dbName]['points'];
}
Expand All @@ -68,11 +65,10 @@ public function getAchievementPoints($force_update = false) {
foreach ($tiered as $dbName => $value) {
$game = strtolower(substr($dbName, 0, strpos($dbName, "_")));
$dbName = strtoupper(substr($dbName, strpos($dbName, "_") + 1));
if (!in_array($game, $games)) {
continue;
}
if (!in_array($game, $games)) continue;
$this->getHypixelPHP()->getLogger()->log('Achievement: ' . $dbName);
if (in_array($dbName, array_keys($achievements[$game]['tiered']))) {
if (array_key_exists("legacy", $achievements[$game]['tiered'][$dbName]) && $achievements[$game]['tiered'][$dbName]["legacy"]) continue;
$tierTotal = 0;
foreach ($achievements[$game]['tiered'][$dbName]['tiers'] as $tier) {
if ($value >= $tier['amount']) {
Expand Down

0 comments on commit eb50b88

Please sign in to comment.