- assert(Sector::current() != NULL);
- floating_image = new _FloatingImage(spritefile);
- Sector::current()->add_object(floating_image);
+ using namespace worldmap;
+
+ floating_image = new _FloatingImage(spritefile);
+ if(Sector::current() != NULL) {
+ Sector::current()->add_object(floating_image.get());
+ } else if(WorldMap::current() != NULL) {
+ WorldMap::current()->add_object(floating_image.get());
+ } else {
+ throw new std::runtime_error("Neither sector nor worldmap active");
+ }