From 7e4a0c24780a38e741a054ed64bcf5397ccaf819 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 28 Apr 2014 15:00:52 +0200 Subject: [PATCH] Removed asserts --- apps/openmw/mwgui/loadingscreen.cpp | 2 -- apps/openmw/mwstate/statemanagerimp.cpp | 7 +++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp index 7917c75f3..7c915ebeb 100644 --- a/apps/openmw/mwgui/loadingscreen.cpp +++ b/apps/openmw/mwgui/loadingscreen.cpp @@ -160,7 +160,6 @@ namespace MWGui void LoadingScreen::setProgress (size_t value) { - assert(value < mProgressBar->getScrollRange()); if (value - mProgress < mProgressBar->getScrollRange()/100.f) return; mProgress = value; @@ -174,7 +173,6 @@ namespace MWGui mProgressBar->setScrollPosition(0); size_t value = mProgress + increase; mProgress = value; - assert(mProgress < mProgressBar->getScrollRange()); mProgressBar->setTrackSize(value / (float)(mProgressBar->getScrollRange()) * mProgressBar->getLineSize()); draw(); } diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp index 33a78330d..6fbd4bb23 100644 --- a/apps/openmw/mwstate/statemanagerimp.cpp +++ b/apps/openmw/mwstate/statemanagerimp.cpp @@ -224,7 +224,8 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot MWBase::Environment::get().getWindowManager()->write(writer, listener); // Ensure we have written the number of records that was estimated - assert (writer.getRecordCount() == recordCount+1); // 1 extra for TES3 record + if (writer.getRecordCount() != recordCount+1) // 1 extra for TES3 record + std::cerr << "Warning: number of written savegame records does not match. Estimated: " << recordCount+1 << ", written: " << writer.getRecordCount() << std::endl; writer.close(); @@ -272,9 +273,7 @@ void MWState::StateManager::loadGame (const Character *character, const Slot *sl Loading::Listener& listener = *MWBase::Environment::get().getWindowManager()->getLoadingScreen(); - // FIXME: +1 is actually not needed, but older savegames had an off-by-one error with the record count - // So we leave this in for now so that these old savegames still work - listener.setProgressRange(reader.getRecordCount()+1); + listener.setProgressRange(reader.getRecordCount()); listener.setLabel("#{sLoadingMessage14}"); Loading::ScopedLoad load(&listener);