summaryrefslogtreecommitdiff
path: root/src/gui/updatewindow.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-01-09 10:08:38 +0100
committerPhilipp Sehmisch <crush@themanaworld.org>2009-01-09 10:08:38 +0100
commit48c1d819bdf112754f3d7ad33f499837018f0759 (patch)
tree099d5b5042e998e0ac85699826823c634c8401ff /src/gui/updatewindow.cpp
parent1e9e9c7ad8003897044531ed421acdd803c45a41 (diff)
downloadmana-48c1d819bdf112754f3d7ad33f499837018f0759.tar.gz
mana-48c1d819bdf112754f3d7ad33f499837018f0759.tar.bz2
mana-48c1d819bdf112754f3d7ad33f499837018f0759.tar.xz
mana-48c1d819bdf112754f3d7ad33f499837018f0759.zip
Fixed nonsensical percent values in update dialog.
Diffstat (limited to 'src/gui/updatewindow.cpp')
-rw-r--r--src/gui/updatewindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp
index 891fa769..c07e0643 100644
--- a/src/gui/updatewindow.cpp
+++ b/src/gui/updatewindow.cpp
@@ -229,8 +229,9 @@ int UpdaterWindow::updateProgress(void *ptr,
float progress = dn / dt;
UpdaterWindow *uw = reinterpret_cast<UpdaterWindow *>(ptr);
- if (progress < 0) progress = 0.0f;
- if (progress > 1) progress = 1.0f;
+ if(progress != progress) progress = 0.0f; // check for NaN
+ if (progress < 0.0f) progress = 0.0f; // no idea how this could ever happen, but why not check for it anyway.
+ if (progress > 1.0f) progress = 1.0f;
uw->setLabel(
uw->mCurrentFile + " (" + toString((int) (progress * 100)) + "%)");