RkShaRkz / Starsector-IntelliJ-Template

Starsector mod template with pre-configured IntelliJ project files and instructions.
The Unlicense
0 stars 1 forks source link

Fix IndexOutOfBoundsException occuring in VayraJoachimEffect #50

Closed RkShaRkz closed 2 months ago

RkShaRkz commented 2 months ago

This PR mainly focuses on fixing an identical problem that was present in VayraDamagedOptics hullmod, which is using a size of one weapon angle offset for all three different weapon angle offsets... and also improves the old fix in VayraDamagedOptics to use the new in-sync rotation approach rather than the wrong in-order that was there until now.

Stacktrace for reference:

java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100) ~[?:?]
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106) ~[?:?]
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302) ~[?:?]
        at java.base/java.util.Objects.checkIndex(Objects.java:365) ~[?:?]
        at java.base/java.util.ArrayList.get(ArrayList.java:428) ~[?:?]
        at data.scripts.weapons.VayraJoachimEffect.advance(VayraJoachimEffect.java:45) ~[?:?]