mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
Update sleep interruption formula according to wiki, thanks Hrnchamd
This commit is contained in:
parent
76fb68a9c0
commit
0442bc98f3
@ -158,11 +158,15 @@ namespace MWGui
|
|||||||
// figure out if player will be woken while sleeping
|
// figure out if player will be woken while sleeping
|
||||||
int x = Misc::Rng::rollDice(hoursToWait);
|
int x = Misc::Rng::rollDice(hoursToWait);
|
||||||
float fSleepRandMod = world->getStore().get<ESM::GameSetting>().find("fSleepRandMod")->getFloat();
|
float fSleepRandMod = world->getStore().get<ESM::GameSetting>().find("fSleepRandMod")->getFloat();
|
||||||
if (x < static_cast<int>(fSleepRandMod * hoursToWait))
|
if (x < fSleepRandMod * hoursToWait)
|
||||||
{
|
{
|
||||||
float fSleepRestMod = world->getStore().get<ESM::GameSetting>().find("fSleepRestMod")->getFloat();
|
float fSleepRestMod = world->getStore().get<ESM::GameSetting>().find("fSleepRestMod")->getFloat();
|
||||||
mInterruptAt = hoursToWait - int(fSleepRestMod * hoursToWait);
|
int interruptAtHoursRemaining = int(fSleepRestMod * hoursToWait);
|
||||||
mInterruptCreatureList = region->mSleepList;
|
if (interruptAtHoursRemaining != 0)
|
||||||
|
{
|
||||||
|
mInterruptAt = hoursToWait - interruptAtHoursRemaining;
|
||||||
|
mInterruptCreatureList = region->mSleepList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user