Replaced Ref and RefCounter with std::shared_ptr<>
[supertux.git] / src / badguy / skydive.cpp
index 244686e..d707636 100644 (file)
@@ -58,10 +58,10 @@ SkyDive::collision_badguy(BadGuy&, const CollisionHit& hit)
 } /* HitResponse collision_badguy */
 
 void
-SkyDive::grab (MovingObject&, const Vector& pos, Direction dir)
+SkyDive::grab (MovingObject&, const Vector& pos, Direction dir_)
 {
   movement = pos - get_pos();
-  this->dir = dir;
+  this->dir = dir_;
 
   is_grabbed = true;
 
@@ -117,14 +117,14 @@ SkyDive::active_update (float elapsed_time)
 void
 SkyDive::explode (void)
 {
-  if (!is_valid ())
+  if (!is_valid())
     return;
 
-  Explosion *explosion = new Explosion (get_anchor_pos (bbox, ANCHOR_BOTTOM));
+  auto explosion = std::make_shared<Explosion>(get_anchor_pos (bbox, ANCHOR_BOTTOM));
 
-  explosion->hurts (true);
-  explosion->pushes (false);
-  Sector::current()->add_object (explosion);
+  explosion->hurts(true);
+  explosion->pushes(false);
+  Sector::current()->add_object(explosion);
 
   remove_me ();
 } /* void explode */