Fix map addressing

This commit is contained in:
Petr Baudis 2011-11-26 22:00:16 +01:00
parent 2c83064fa9
commit a72882a743
2 changed files with 3 additions and 3 deletions

4
map.h
View file

@ -44,14 +44,14 @@ public:
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
tiles[y * h + x] = new tile_ground(x, y, *this);
tiles[y * w + x] = new tile_ground(x, y, *this);
}
}
};
class tile &tile_at(int x, int y)
{
return *tiles[y * h + x];
return *tiles[y * w + x];
};
void print_map(void);