Post the line that the error is on then?
|
Hello anyone help me with this error please. i will rep++.
[1/15/12 2:11 AM]: java.lang.ArrayIndexOutOfBoundsException: -1
[1/15/12 2:11 AM]: at server.world.WalkingHandler$TiledMap.getFlag(Walki ngH
andler.java:67)
[1/15/12 2:11 AM]: at server.world.WalkingHandler.traversable(WalkingHan dle
r.java:27)
[1/15/12 2:11 AM]: at server.model.npcs.NPC.getNextWalkingDirection(NPC. jav
a:233)
[1/15/12 2:11 AM]: at server.model.npcs.NPC.getNextNPCMovement(NPC.java: 244
)
[1/15/12 2:11 AM]: at server.model.npcs.NPCHandler.followPlayer(NPCHandl er.
java:2810)
[1/15/12 2:11 AM]: at server.model.npcs.NPCHandler.process(NPCHandler.ja va:
1857)
[1/15/12 2:11 AM]: at server.Server.main(Server.java:200)
Post the line that the error is on then?
i dont even understand where the error is mate thats what im saying
Marked in red is where the problem is at post it pls?Code:[1/15/12 2:11 AM]: java.lang.ArrayIndexOutOfBoundsException: -1 [1/15/12 2:11 AM]: at server.world.WalkingHandler$TiledMap.getFlag(Walki ngH andler.java:67) [1/15/12 2:11 AM]: at server.world.WalkingHandler.traversable(WalkingHan dle r.java:27) [1/15/12 2:11 AM]: at server.model.npcs.NPC.getNextWalkingDirection(NPC. jav a:233) [1/15/12 2:11 AM]: at server.model.npcs.NPC.getNextNPCMovement(NPC.java: 244 ) [1/15/12 2:11 AM]: at server.model.npcs.NPCHandler.followPlayer(NPCHandl er. java:2810) [1/15/12 2:11 AM]: at server.model.npcs.NPCHandler.process(NPCHandler.ja va: 1857) [1/15/12 2:11 AM]: at server.Server.main(Server.java:200)
here you go sorry
public void initialize() throws Exception {
long delta = System.currentTimeMillis();
RandomAccessFile raf = new RandomAccessFile("data/lolmap.bin", "r");
FileChannel channel = raf.getChannel();
MappedByteBuffer buffer = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
int length = buffer.getInt();
for(int i = 0; i < length; i++) {
int x = buffer.getShort();
int y = buffer.getShort();
byte flag = buffer.get();
map.flag(x, y, flag);
}
System.out.println("Loaded clipmap in " + (System.currentTimeMillis() - delta) + "ms.");
}
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;
}
}
}
So have you like, tryed to add castle wars or something? Can you tell me what that is for ?
Code:public int getFlag(int x, int y) { return plane[x * 10000 + y]; }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |