Skip to content

Commit

Permalink
Fixed vote key time slot logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninjasoturi committed Mar 17, 2024
1 parent 6b668aa commit 614d594
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions logic/keys_vote.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ function generateTimeslotKeys($RAID_SLOTS, $raid) {
$five_slot = $five_slot->add(new DateInterval('PT'.$diff.'M'));

// Get first regular raidslot
$first_slot = $five_slot->add(new DateInterval('PT'.$RAID_SLOTS.'M'));
$first_slot =
($minute == 0) ?
$direct_slot->add(new DateInterval('PT'.$RAID_SLOTS.'M')) :
$five_slot->add(new DateInterval('PT'.$RAID_SLOTS.'M')
);

// Write slots to log.
debug_log($direct_slot, 'Direct start slot:');
Expand All @@ -274,7 +278,10 @@ function generateTimeslotKeys($RAID_SLOTS, $raid) {
$last_slot = $direct_slot;
}
// Add five minutes slot
if($five_slot >= $dt_now && (empty($keys_time) || (!empty($keys_time) && $direct_slot != $five_slot))) {
if($five_slot >= $dt_now &&
(empty($keys_time) || (!empty($keys_time) && $direct_slot != $five_slot)) &&
$raid['event_vote_key_mode'] !== 0
) {
$keys_time[] = button(dt2time($five_slot->format('Y-m-d H:i:s')), ['vote_time', 'r' => $raid['id'], 't' => $five_slot->format('YmdHis')]);
$last_slot = $five_slot;
}
Expand Down

0 comments on commit 614d594

Please sign in to comment.