EmergentOrganization / cell-rpg

:black_square_button: connect to a universe where cellular automata have run rampant
http://emergentorganization.github.io/bridge/
Other
12 stars 1 forks source link

weapon powerup can boost charge too high for animation (indexOutOfBounds) #113

Closed 7yl4r closed 8 years ago

7yl4r commented 8 years ago
Exception in thread "LWJGL Application" java.lang.IndexOutOfBoundsException: Index: 10, Size: 5
    at java.util.ArrayList.rangeCheck(ArrayList.java:635)
    at java.util.ArrayList.get(ArrayList.java:411)
    at java.util.Collections$UnmodifiableList.get(Collections.java:1211)
    at io.github.emergentorganization.cellrpg.core.entityfactory.Entities.Equipment.ChargeAnimatedEquipment.getChargeFrame(ChargeAnimatedEquipment.java:61)
    at io.github.emergentorganization.cellrpg.core.entityfactory.Entities.Equipment.ChargeAnimatedEquipment.getChargeFrame(ChargeAnimatedEquipment.java:54)
    at io.github.emergentorganization.cellrpg.core.entityfactory.Entities.Equipment.ChargeAnimatedEquipment.onChargeChanged(ChargeAnimatedEquipment.java:50)
    at io.github.emergentorganization.cellrpg.core.entityfactory.Entities.Equipment.Weapon.recharge(Weapon.java:71)
    at io.github.emergentorganization.cellrpg.components.EquipmentList.rechargeEquipment(EquipmentList.java:27)
    at io.github.emergentorganization.cellrpg.systems.EnergySystem.process(EnergySystem.java:35)
    at com.artemis.systems.IntervalEntityProcessingSystem.processEntities(IntervalEntityProcessingSystem.java:48)
7yl4r commented 8 years ago

This could be fixed by improving handling of Equipment.charge . It should be made private and setter should trigger onChargeChange.

7yl4r commented 8 years ago

closed by 1836912