Removed a global variable
[supertux.git] / src / sector.cpp
index f746eec..0d8bcc1 100644 (file)
@@ -70,8 +70,8 @@ Sector* Sector::_current = 0;
 bool Sector::show_collrects = false;
 bool Sector::draw_solids_only = false;
 
-Sector::Sector()
-  : currentmusic(LEVEL_MUSIC), gravity(10),
+Sector::Sector(Level* parent)
+  : level(parent), currentmusic(LEVEL_MUSIC), gravity(10),
     player(0), solids(0), camera(0)
 {
   add_object(new Player(player_status));
@@ -120,6 +120,12 @@ Sector::~Sector()
     delete *i;
 }
 
+Level*
+Sector::get_level()
+{
+  return level;
+}
+
 GameObject*
 Sector::parse_object(const std::string& name, const lisp::Lisp& reader)
 {
@@ -1165,7 +1171,7 @@ Sector::inside(const Rect& rect) const
 {
   if(rect.p1.x > solids->get_width() * 32 
       || rect.p1.y > solids->get_height() * 32
-      || rect.p2.x < 0 || rect.p2.y < 0)
+      || rect.p2.x < 0)
     return false;
 
   return true;