Issue #440: Make day numbers start at 1 instead of 0

actorid
Marc Zinnschlag 12 years ago
parent accf8b2f71
commit 61942c9c4a

@ -122,7 +122,7 @@ namespace MWGui
if (hour >= 13) hour -= 12;
std::string dateTimeText =
boost::lexical_cast<std::string>(MWBase::Environment::get().getWorld ()->getDay ()+1) + " "
boost::lexical_cast<std::string>(MWBase::Environment::get().getWorld ()->getDay ()) + " "
+ month + " (#{sDay} " + boost::lexical_cast<std::string>(MWBase::Environment::get().getWorld ()->getTimeStamp ().getDay ()+1)
+ ") " + boost::lexical_cast<std::string>(hour) + " " + (pm ? "#{sSaveMenuHelp05}" : "#{sSaveMenuHelp04}");

@ -407,15 +407,15 @@ namespace MWWorld
void World::setDay (int day)
{
if (day<0)
day = 0;
if (day<1)
day = 1;
int month = mGlobalVariables->getInt ("month");
while (true)
{
int days = getDaysPerMonth (month);
if (day<days)
if (day<=days)
break;
if (month<11)
@ -437,8 +437,6 @@ namespace MWWorld
mRendering->skySetDate (day, month);
mWeatherManager->setDate (day, month);
}
void World::setMonth (int month)
@ -451,8 +449,8 @@ namespace MWWorld
int days = getDaysPerMonth (month);
if (mGlobalVariables->getInt ("day")>=days)
mGlobalVariables->setInt ("day", days-1);
if (mGlobalVariables->getInt ("day")>days)
mGlobalVariables->setInt ("day", days);
mGlobalVariables->setInt ("month", month);

Loading…
Cancel
Save