From: Christoph Sommer Date: Wed, 1 Nov 2006 03:06:18 +0000 (+0000) Subject: No more count-to-infinity for the coins display X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8372bc7834408184195e060a3f9bfef90b2365b6;p=supertux.git No more count-to-infinity for the coins display SVN-Revision: 4428 --- diff --git a/src/player_status.cpp b/src/player_status.cpp index 95a1c11c0..44512a1da 100644 --- a/src/player_status.cpp +++ b/src/player_status.cpp @@ -19,6 +19,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include +#include #include "lisp/writer.hpp" #include "lisp/lisp.hpp" #include "player_status.hpp" @@ -135,7 +136,9 @@ PlayerStatus::draw(DrawingContext& context) static int displayed_coins = -1; static int next_count = 0; - if (displayed_coins == -1) displayed_coins = coins; + if ((displayed_coins == -1) || (fabsf(displayed_coins - coins) > 100)) { + displayed_coins = coins; + } if (++next_count > 2) { next_count = 0; if (displayed_coins < coins) displayed_coins++;