Use data instead of throwaway_data for slope and short-circuit || instead of if(...
authormathnerd314 <mathnerd314@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Sun, 6 Dec 2009 04:29:17 +0000 (04:29 +0000)
committermathnerd314 <mathnerd314@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Sun, 6 Dec 2009 04:29:17 +0000 (04:29 +0000)
git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6179 837edb03-e0f3-0310-88ca-d4d4e8b29345

src/supertux/tile_set_parser.cpp

index 2ed1264..255b27a 100644 (file)
@@ -120,8 +120,7 @@ TileSetParser::parse_tile(const Reader& reader)
   reader.get("data", data);
   reader.get("anim-fps", anim_fps);
 
-  uint32_t throwaway_data;
-  if(reader.get("slope-type", throwaway_data)) 
+  if(reader.get("slope-type", data)) 
   {
     attributes |= Tile::SOLID | Tile::SLOPE;
   }
@@ -226,10 +225,7 @@ TileSetParser::parse_tiles(const Reader& reader)
   bool has_attributes = reader.get("attributes", attributes);
   bool has_datas = reader.get("datas", datas);
 
-  if (!reader.get("image", images))
-  {
-    reader.get("images", images);
-  }
+  reader.get("image", images) || reader.get("images", images);
 
   reader.get("width",      width);
   reader.get("height",     height);