diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameSaver.java b/core/src/ru/deadsoftware/cavecraft/game/GameSaver.java
index c4e13a640a737ec58b8bf1a1a9bb6c425a42c2c5..00d91bf3b4ec9f50860cdcbb1969c44c8dbc5f64 100644 (file)
out.write(intToBytes(VERSION));
out.write(intToBytes(width));
out.write(intToBytes(height));
- for (int y = 0; y < map[0].length; y++) {
+ for (int y = 0; y < height; y++) {
bl = map[0][y];
rl = 0;
- for (int x = 0; x < map.length; x++) {
+ for (int x = 0; x < width; x++) {
if (map[x][y] != bl) {
out.write(intToBytes(rl));
out.write(intToBytes(bl));