- fixed scrolling past level bug
authorRyan Flegel <rflegel@gmail.com>
Wed, 5 May 2004 04:04:05 +0000 (04:04 +0000)
committerRyan Flegel <rflegel@gmail.com>
Wed, 5 May 2004 04:04:05 +0000 (04:04 +0000)
SVN-Revision: 989

src/world.cpp

index 7045340..00b075a 100644 (file)
@@ -371,8 +371,8 @@ void World::scrolling(double frame_ratio)
   // this code prevent the screen to scroll before the start or after the level's end
   if(scroll_x < 0)
     scroll_x = 0;
-  if(scroll_x > (level->width-1) * 32)
-    scroll_x = (level->width-1) * 32;
+  if(scroll_x > level->width * 32 - screen->w)
+    scroll_x = level->width * 32 - screen->w;
 }
 
 void