From 417eb2167a3a8a5eb41bb18be5398bbd46f7bf29 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Sat, 28 Oct 2006 14:36:05 +0000 Subject: [PATCH] Keep behaviour of invisible tiles the same when reading old levels SVN-Revision: 4426 --- src/sector.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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); } -- 2.11.0