Please help, this is the error that crashes my server while im sleeping
If you need any more codes let me know.
Code:
[6/9/11 7:19 AM]: java.lang.ArrayIndexOutOfBoundsException: -1
[6/9/11 7:19 AM]: at server.world.WalkingHandler$TiledMap.getFlag(WalkingH
andler.java:67)
[6/9/11 7:19 AM]: at server.world.WalkingHandler.traversable(WalkingHandle
r.java:27)
[6/9/11 7:19 AM]: at server.model.npcs.NPC.getNextWalkingDirection(NPC.jav
a:224)
[6/9/11 7:19 AM]: at server.model.npcs.NPC.getNextNPCMovement(NPC.java:235
)
[6/9/11 7:19 AM]: at server.model.npcs.NPCHandler.followPlayer(NPCHandler.
java:2733)
[6/9/11 7:19 AM]: at server.model.npcs.NPCHandler.process(NPCHandler.java:
1826)
[6/9/11 7:19 AM]: at server.Server.main(Server.java:173)
[6/9/11 7:19 AM]: A fatal exception has been thrown!
[6/9/11 7:19 AM]: Saved game for mumiownz.
[6/9/11 7:19 AM]: Saved game for cromulent.
[6/9/11 7:19 AM]: Saved game for grokdi.
[6/9/11 7:19 AM]: Saved game for k i l l.
[6/9/11 7:19 AM]: Saved game for oldy dony.
[6/9/11 7:19 AM]: Saved game for x mage x.
[6/9/11 7:19 AM]: Saved game for strnoob485.
[6/9/11 7:19 AM]: Saved game for whydoicare.
[6/9/11 7:19 AM]: Saved game for x pure x.
[6/9/11 7:19 AM]: Saved game for maverik.
[6/9/11 7:19 AM]: Saved game for jj.
[6/9/11 7:19 AM]: Saved game for nxer123.
[6/9/11 7:19 AM]: Saved game for lion.
[6/9/11 7:19 AM]: Saved game for dppv1.
etc...
Code:
private static class TiledMap {
private final byte[] plane;
public TiledMap(int width, int height) {
this.plane = new byte[width * 10000 + height];
}
public int getFlag(int x, int y) {
return plane[x * 10000 + y];
}
public void flag(int x, int y, byte flag) {
this.plane[x * 10000 + y] = flag;
}
}
}
Red is line 67