Pause music when pressing ESC during a level and resume it when exiting the pause...
[supertux.git] / src / scripting / floating_image.cpp
index 2264d0d..77fe80b 100644 (file)
 namespace scripting {
 
 FloatingImage::FloatingImage(const std::string& spritefile) :
-  floating_image()
+  floating_image(std::make_shared<_FloatingImage>(spritefile))
 {
   using namespace worldmap;
 
-  floating_image = std::make_shared<_FloatingImage>(spritefile);
   if(Sector::current() != NULL) {
     Sector::current()->add_object(floating_image);
   } else if(WorldMap::current() != NULL) {