From: Ryan Flegel Date: Wed, 5 May 2004 04:04:05 +0000 (+0000) Subject: - fixed scrolling past level bug X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=da4a28a319f7dc15ea109c6bdf8da2483f67dbdb;p=supertux.git - fixed scrolling past level bug SVN-Revision: 989 --- diff --git a/src/world.cpp b/src/world.cpp index 704534062..00b075a4b 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -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