bogstandard / rl-weather

Weather plugin for RuneLite
BSD 2-Clause "Simplified" License
9 stars 3 forks source link

Setting Dither to 0 breaks the plugin #1

Closed Cyborger1 closed 2 years ago

Cyborger1 commented 3 years ago

You might want to add a @Range annotation to the two dither config fields to prevent users from setting the value to 0.

The plugin stops working completely when this happens, even after turning it off and on. You may also want to clear the Drops array in shutdown() in case something like this happens.

2021-09-04 15:25:22 [Client] WARN  n.r.c.ui.overlay.OverlayRenderer - Error during overlay rendering
java.lang.IllegalArgumentException: bound must be positive
    at java.base/java.util.Random.nextInt(Unknown Source)
    at com.rlweather.Drop.update(Drop.java:42)
    at com.rlweather.RlweatherOverlay.renderDrops(RlweatherOverlay.java:163)
    at com.rlweather.RlweatherOverlay.render(RlweatherOverlay.java:67)
    at net.runelite.client.ui.overlay.OverlayRenderer.safeRender(OverlayRenderer.java:747)
    ...