Tanner/Oregon-Trail — Issue #120: index out of range in store
Author: jturner65
Created: 2011-12-01 16:53:09+00:00
State: open

it's apparently attempting to
here's the stack trace from entering the store - i had horses and then found oxen on the trail, and maybe that fact has to do with the error - it's in this code, index of -1 :

for (ItemType item : inv.getPopulatedSlots() ) {
storeInventory[getButtonIndex(item)].setMax(inv.getNumberOf(item));
storeInventory[getButtonIndex(item)].setCount(inv.getNumberOf(item));
}

INFO - 12/01/2011 11:44:23:815 EST - dfsaadsf, the Banker, entered the town.
Thu Dec 01 11:44:33 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/apple.png
Thu Dec 01 11:44:33 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/bread.png
Thu Dec 01 11:44:33 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/meat.png
Thu Dec 01 11:44:33 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/ox.png
Thu Dec 01 11:44:33 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/tools.png
[Horse, Horse, Horse, Horse, Horse, Ox, Ox, Ox]
Thu Dec 01 11:44:36 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/ammo.png
Thu Dec 01 11:44:36 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/gun.png
Thu Dec 01 11:44:36 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/axle.png
Thu Dec 01 11:44:36 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/ammo.png
Thu Dec 01 11:44:36 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/gun.png
Thu Dec 01 11:44:36 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/axle.png
Thu Dec 01 11:44:36 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/ammo.png
Thu Dec 01 11:44:36 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/tools.png
Thu Dec 01 11:44:36 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/ammo.png
Thu Dec 01 11:44:36 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/tools.png
INFO - 12/01/2011 11:44:40:620 EST - Item was removed! Item was AXLE
Thu Dec 01 11:44:40 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/axle.png
Thu Dec 01 11:44:40 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/ammo.png
Thu Dec 01 11:44:40 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/gun.png
Thu Dec 01 11:44:40 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/axle.png
INFO - 12/01/2011 11:44:41:366 EST - Item was removed! Item was AXLE
Thu Dec 01 11:44:41 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/axle.png
Thu Dec 01 11:44:41 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/ammo.png
Thu Dec 01 11:44:41 EST 2011 INFO:Early loading of deferred resource due to req: resources/graphics/icons/items/gun.png
INFO - 12/01/2011 11:44:42:529 EST - Party money changed to: $400
Thu Dec 01 11:44:47 EST 2011 ERROR:-1
java.lang.ArrayIndexOutOfBoundsException: -1
at scene.StoreScene.enter(StoreScene.java:173)
at org.newdawn.slick.state.StateBasedGame.update(StateBasedGame.java:261)
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:657)
at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:408)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:318)
at core.GameDirector.start(GameDirector.java:75)
at core.GameDirector.main(GameDirector.java:324)
Thu Dec 01 11:44:47 EST 2011 ERROR:Game.update() failure - check the game code.
org.newdawn.slick.SlickException: Game.update() failure - check the game code.
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:663)
at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:408)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:318)
at core.GameDirector.start(GameDirector.java:75)
at core.GameDirector.main(GameDirector.java:324)