Skip to content

Commit

Permalink
fix: off-by-1 in timeutil used by rain command
Browse files Browse the repository at this point in the history
  • Loading branch information
ToxicMushroom committed May 24, 2024
1 parent 6734693 commit a83534c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bot/src/main/kotlin/me/melijn/bot/utils/TimeUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object TimeUtil {

// 0h[+++++++++++++[++|24h ?
val overflowingTime = this.time.toNanosecondOfDay().nanoseconds + rest
val timeOverflowed = overflowingTime > 1.days
val timeOverflowed = overflowingTime >= 1.days

// 0h[++++++|------]24h
val newTimeDuration = if (timeOverflowed) overflowingTime - 1.days else overflowingTime
Expand Down

0 comments on commit a83534c

Please sign in to comment.