Removed asserts

actorid
scrawl 11 years ago
parent 138fb4e29a
commit 7e4a0c2478

@ -160,7 +160,6 @@ namespace MWGui
void LoadingScreen::setProgress (size_t value) void LoadingScreen::setProgress (size_t value)
{ {
assert(value < mProgressBar->getScrollRange());
if (value - mProgress < mProgressBar->getScrollRange()/100.f) if (value - mProgress < mProgressBar->getScrollRange()/100.f)
return; return;
mProgress = value; mProgress = value;
@ -174,7 +173,6 @@ namespace MWGui
mProgressBar->setScrollPosition(0); mProgressBar->setScrollPosition(0);
size_t value = mProgress + increase; size_t value = mProgress + increase;
mProgress = value; mProgress = value;
assert(mProgress < mProgressBar->getScrollRange());
mProgressBar->setTrackSize(value / (float)(mProgressBar->getScrollRange()) * mProgressBar->getLineSize()); mProgressBar->setTrackSize(value / (float)(mProgressBar->getScrollRange()) * mProgressBar->getLineSize());
draw(); draw();
} }

@ -224,7 +224,8 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot
MWBase::Environment::get().getWindowManager()->write(writer, listener); MWBase::Environment::get().getWindowManager()->write(writer, listener);
// Ensure we have written the number of records that was estimated // 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(); writer.close();
@ -272,9 +273,7 @@ void MWState::StateManager::loadGame (const Character *character, const Slot *sl
Loading::Listener& listener = *MWBase::Environment::get().getWindowManager()->getLoadingScreen(); 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 listener.setProgressRange(reader.getRecordCount());
// So we leave this in for now so that these old savegames still work
listener.setProgressRange(reader.getRecordCount()+1);
listener.setLabel("#{sLoadingMessage14}"); listener.setLabel("#{sLoadingMessage14}");
Loading::ScopedLoad load(&listener); Loading::ScopedLoad load(&listener);

Loading…
Cancel
Save