From: Christoph Sommer Date: Sat, 28 Oct 2006 14:36:05 +0000 (+0000) Subject: Keep behaviour of invisible tiles the same when reading old levels X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=417eb2167a3a8a5eb41bb18be5398bbd46f7bf29;p=supertux.git Keep behaviour of invisible tiles the same when reading old levels SVN-Revision: 4426 --- diff --git a/src/sector.cpp b/src/sector.cpp index f43170afb..7ef504925 100644 --- a/src/sector.cpp +++ b/src/sector.cpp @@ -289,6 +289,15 @@ Sector::parse_old_format(const lisp::Lisp& reader) || reader.get_vector("tilemap", tiles)) { TileMap* tilemap = new TileMap(); tilemap->set(width, height, tiles, LAYER_TILES, true); + + // replace tile id 112 (old invisible tile) with 1311 (new invisible tile) + for(size_t x=0; x < tilemap->get_width(); ++x) { + for(size_t y=0; y < tilemap->get_height(); ++y) { + const Tile* tile = tilemap->get_tile(x, y); + if(tile->getID() == 112) tilemap->change(x, y, 1311); + } + } + add_object(tilemap); }