Replaced Ref and RefCounter with std::shared_ptr<>
[supertux.git] / src / badguy / darttrap.cpp
index 3885cb6..1fb822e 100644 (file)
@@ -97,7 +97,7 @@ DartTrap::fire()
   py += MUZZLE_Y;
 
   SoundManager::current()->play("sounds/dartfire.wav", get_pos());
-  Sector::current()->add_object(new Dart(Vector(px, py), dir, this));
+  Sector::current()->add_object(std::make_shared<Dart>(Vector(px, py), dir, this));
   state = IDLE;
   sprite->set_action(dir == LEFT ? "idle-left" : "idle-right");
 }