Added flame fish.
[supertux.git] / src / sector.cpp
index a108e30..17775a3 100644 (file)
@@ -423,6 +423,12 @@ Sector::update_game_objects()
             std::remove(flying_platforms.begin(), flying_platforms.end(), flying_platform),
             flying_platforms.end());
       }
+      SmokeCloud* smoke_cloud = dynamic_cast<SmokeCloud*> (*i);
+      if(smoke_cloud) {
+        smoke_clouds.erase(
+            std::remove(smoke_clouds.begin(), smoke_clouds.end(), smoke_cloud),
+            smoke_clouds.end());
+      }
                                                                                 
       delete *i;
       i = gameobjects.erase(i);
@@ -454,6 +460,10 @@ Sector::update_game_objects()
               = dynamic_cast<InteractiveObject*> (*i);
           if(interactive_object)
             interactive_objects.push_back(interactive_object);
+          SmokeCloud* smoke_cloud = dynamic_cast<SmokeCloud*> (*i);
+          if(smoke_cloud)
+            smoke_clouds.push_back(smoke_cloud);
+
 
           gameobjects.push_back(*i);
   }
@@ -674,6 +684,13 @@ Sector::add_bullet(const Vector& pos, float xm, Direction dir)
   return true;
 }
 
+bool
+Sector::add_smoke_cloud(const Vector& pos)
+{
+  add_object(new SmokeCloud(pos));
+  return true;
+}
+
 /* Break a brick: */
 bool
 Sector::trybreakbrick(const Vector& pos, bool small)
@@ -787,7 +804,7 @@ Sector::tryemptybox(const Vector& pos, Direction col_side)
       break;
                                                                                 
     case 3: // Add a golden herring
-      add_upgrade(Vector(posx, posy), col_side, UPGRADE_HERRING);
+      add_upgrade(Vector(posx, posy), col_side, UPGRADE_STAR);
       break;
                                                                                 
     case 4: // Add a 1up extra