X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftile_manager.cpp;h=0c87f4e3fb02054fba26e486ab6281bd5b1076e4;hb=6c61f312a1f5a768e202195ca18ed5a51974bdcc;hp=47b4cc273082912aa2455c53a66d13970fa45f92;hpb=71e724e90583aae6541cf060792fc6c3deff8bdb;p=supertux.git diff --git a/src/tile_manager.cpp b/src/tile_manager.cpp index 47b4cc273..0c87f4e3f 100644 --- a/src/tile_manager.cpp +++ b/src/tile_manager.cpp @@ -80,7 +80,7 @@ void TileManager::load_tileset(std::string filename) continue; }*/ - tiles.insert(std::make_pair(tile_id, tile)); + tiles[tile_id] = tile; } else if (strcmp(lisp_symbol(lisp_car(element)), "tileset") == 0) { @@ -152,16 +152,8 @@ Tile* TileManager::get(unsigned int id) { Tiles::iterator i = tiles.find(id); - if(i == tiles.end()) - { - std::cerr << "Warning: Asked for a non-existing tile id. Ignoring.\n"; - // Never return 0, but return the first tile instead so that - // user code doesn't have to check for NULL pointers all over - // the place - i = tiles.begin(); - return i->second; - } + return 0; return i->second; }