1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 12:49:40 +00:00

Fixes #1195: Make NPCs equip torches in interiors under certain conditions

This commit is contained in:
scrawl 2014-04-28 18:33:42 +02:00
parent 84961d7843
commit 518a32c19d

View file

@ -2506,7 +2506,17 @@ namespace MWWorld
bool World::isDark() const
{
MWWorld::CellStore* cell = mPlayer->getPlayer().getCell();
if (cell->isExterior())
return mWeatherManager->isDark();
else
{
uint32_t ambient = cell->getCell()->mAmbi.mAmbient;
int ambientTotal = (ambient & 0xff)
+ ((ambient>>8) & 0xff)
+ ((ambient>>16) & 0xff);
return !(cell->getCell()->mData.mFlags & ESM::Cell::NoSleep) && ambientTotal <= 201;
}
}
bool World::findInteriorPositionInWorldSpace(MWWorld::CellStore* cell, Ogre::Vector3& result)