Skip to content

Commit

Permalink
Another wormhole fix to raid_hour_creator
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninjasoturi committed May 29, 2024
1 parent 4648990 commit 75fd157
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions core/tools/automate_raid_hour_creation/raid_hour_creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,20 @@ function get_current_bosses($spawn) {
$i = 0;
$levels = [5, 7, 8]; // Search potential raid hour bosses from these raid levels
$pokemon = $pokemon_form = false;
do {
$pk = $dbh->prepare('SELECT pokedex_id,pokemon_form_id FROM raid_bosses WHERE raid_level = ? AND ? BETWEEN date_start AND date_end');
$pk->execute([$levels[$i], $spawn]);
foreach($levels as $level) {
$pk = $dbh->prepare('SELECT pokedex_id,pokemon_form_id FROM raid_bosses WHERE raid_level = ? AND ? BETWEEN date_start AND date_end and disabled = 0');
$pk->execute([$level, $spawn]);
$res = $pk->fetch();
if($pk->rowCount() == 1) {
$pokemon = $res['pokedex_id'];
$pokemon_form = $res['pokemon_form_id'];
break;
}elseif($pk->rowCount() > 1) {
$pokemon = 999 . $levels[$i];
$pokemon = 999 . $level;
$pokemon_form = 0;
break;
}
$i++;
} while($pk->rowcount() > 0 or $i <= 1);
}
if($pokemon === false) return false;
return [$pokemon,$pokemon_form];
}
Expand Down

0 comments on commit 75fd157

Please sign in to comment.