EhWhoAmI / Conquer-Space

Conquer Space!
GNU Affero General Public License v3.0
3 stars 0 forks source link

ArrayIndexOutOfBoundsException in generation script #2

Closed EhWhoAmI closed 6 years ago

EhWhoAmI commented 6 years ago

Stack Trace:

File "/Users/lamkokheng/Desktop/Conquer-Space/assets/scripts/universeGen/main.py", line 256, in <module>
    homeP.setPlanetSector(planetSectorID, PopulationStorage(CIV_STARTING_POP_STORAGE_MAX, CIV_STARTING_POPULATION, 100, planetSectorID));
    at ConquerSpace.game.universe.spaceObjects.Planet.setPlanetSector(Planet.java:117)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)

java.lang.ArrayIndexOutOfBoundsException: java.lang.ArrayIndexOutOfBoundsException: 0

org.python.core.PyException: null
    at org.python.core.Py.JavaError(Py.java:546) ~[jython-standalone-2.7.0.jar:?]
    at org.python.core.Py.JavaError(Py.java:537) ~[jython-standalone-2.7.0.jar:?]
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188) ~[jython-standalone-2.7.0.jar:?]
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204) ~[jython-standalone-2.7.0.jar:?]
    at org.python.core.PyObject.__call__(PyObject.java:496) ~[jython-standalone-2.7.0.jar:?]
    at org.python.core.PyObject.__call__(PyObject.java:500) ~[jython-standalone-2.7.0.jar:?]
    at org.python.core.PyMethod.__call__(PyMethod.java:156) ~[jython-standalone-2.7.0.jar:?]
    at org.python.pycode._pyx0.f$0(/Users/lamkokheng/Desktop/Conquer-Space/assets/scripts/universeGen/main.py:213) ~[?:?]
    at org.python.pycode._pyx0.call_function(/Users/lamkokheng/Desktop/Conquer-Space/assets/scripts/universeGen/main.py) ~[?:?]
    at org.python.core.PyTableCode.call(PyTableCode.java:167) ~[jython-standalone-2.7.0.jar:?]
    at org.python.core.PyCode.call(PyCode.java:18) ~[jython-standalone-2.7.0.jar:?]
    at org.python.core.Py.runCode(Py.java:1386) ~[jython-standalone-2.7.0.jar:?]
    at org.python.core.__builtin__.execfile_flags(__builtin__.java:535) ~[jython-standalone-2.7.0.jar:?]
    at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:286) ~[jython-standalone-2.7.0.jar:?]
    at ConquerSpace.util.scripts.RunScript.exec(RunScript.java:34) ~[classes/:?]
    at ConquerSpace.start.gui.NewGame.actionPerformed(NewGame.java:235) [classes/:?]
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) [?:1.8.0_05]
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346) [?:1.8.0_05]
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) [?:1.8.0_05]
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) [?:1.8.0_05]
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) [?:1.8.0_05]
    at java.awt.Component.processMouseEvent(Component.java:6527) [?:1.8.0_05]
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321) [?:1.8.0_05]
    at java.awt.Component.processEvent(Component.java:6292) [?:1.8.0_05]
    at java.awt.Container.processEvent(Container.java:2234) [?:1.8.0_05]
    at java.awt.Component.dispatchEventImpl(Component.java:4883) [?:1.8.0_05]
    at java.awt.Container.dispatchEventImpl(Container.java:2292) [?:1.8.0_05]
    at java.awt.Component.dispatchEvent(Component.java:4705) [?:1.8.0_05]
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898) [?:1.8.0_05]
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533) [?:1.8.0_05]
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462) [?:1.8.0_05]
    at java.awt.Container.dispatchEventImpl(Container.java:2278) [?:1.8.0_05]
    at java.awt.Window.dispatchEventImpl(Window.java:2739) [?:1.8.0_05]
    at java.awt.Component.dispatchEvent(Component.java:4705) [?:1.8.0_05]
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746) [?:1.8.0_05]
    at java.awt.EventQueue.access$400(EventQueue.java:97) [?:1.8.0_05]
    at java.awt.EventQueue$3.run(EventQueue.java:697) [?:1.8.0_05]
    at java.awt.EventQueue$3.run(EventQueue.java:691) [?:1.8.0_05]
    at java.security.AccessController.doPrivileged(Native Method) [?:1.8.0_05]
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) [?:1.8.0_05]
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86) [?:1.8.0_05]
    at java.awt.EventQueue$4.run(EventQueue.java:719) [?:1.8.0_05]
    at java.awt.EventQueue$4.run(EventQueue.java:717) [?:1.8.0_05]
    at java.security.AccessController.doPrivileged(Native Method) [?:1.8.0_05]
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) [?:1.8.0_05]
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:716) [?:1.8.0_05]
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [?:1.8.0_05]
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [?:1.8.0_05]
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [?:1.8.0_05]
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:1.8.0_05]
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [?:1.8.0_05]
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [?:1.8.0_05]
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    at ConquerSpace.game.universe.spaceObjects.Planet.setPlanetSector(Planet.java:117) ~[classes/:?]
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05]
    at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05]
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186) ~[jython-standalone-2.7.0.jar:?]
    ... 49 more

Probably is when the planet's sectors is 0, if the planet is small enough. (About 1 - 5 size)

EhWhoAmI commented 6 years ago

Apparently fixed with a07756ae4b0da7b604a952f89d0a9e877caf5538

EhWhoAmI commented 6 years ago

Truly fixed with commit e3b4643