Skip to content
Permalink
Browse files

Remove the hardcoded (and apparently arbitrary) cap on oter_id

  • Loading branch information...
ethankaminski committed Apr 27, 2013
1 parent 20b12b9 commit f889246ea33cf9988519448022c7f8ec1377e7e5
Showing with 2 additions and 8 deletions.
  1. +2 −8 overmap.cpp
@@ -134,8 +134,6 @@ overmap::overmap()
, nullstr("")
{
// debugmsg("Warning - null overmap!");
if (num_ter_types > 256 - 32)
debugmsg("More than 256 - 32 oterid! Saving won't work!");
}

overmap::overmap(game *g, int x, int y)
@@ -151,10 +149,6 @@ overmap::overmap(game *g, int x, int y)
debugmsg("Attempting to load overmap for unknown player! Saving won't work!");
}

if (num_ter_types > 256 - 32) {
debugmsg("More than 256 - 32 oterid! Saving won't work!");
}

if (g->has_gametype()) {
prefix = special_game_name(g->gametype());
}
@@ -2661,7 +2655,7 @@ void overmap::save()
fout << "L " << z << std::endl;
for (int j = 0; j < OMAPY; j++) {
for (int i = 0; i < OMAPX; i++) {
fout << char(int(layer[z].terrain[i][j]) + 32);
fout << int(layer[z].terrain[i][j]) + 32;
}
fout << std::endl;
}
@@ -2716,7 +2710,7 @@ void overmap::open(game *g)
getline(fin, dataline);
if (z >= 0 && z < OVERMAP_LAYERS) {
for (int i = 0; i < OMAPX; i++) {
layer[z].terrain[i][j] = oter_id((unsigned char)dataline[i] - 32);
layer[z].terrain[i][j] = oter_id(dataline[i] - 32);
layer[z].visible[i][j] = false;
if (layer[z].terrain[i][j] < 0 || layer[z].terrain[i][j] > num_ter_types)
debugmsg("Loaded bad ter! %s; ter %d", terfilename.c_str(), layer[z].terrain[i][j]);

0 comments on commit f889246

Please sign in to comment.
You can’t perform that action at this time.