|
|
|
@ -236,6 +236,7 @@ namespace MWMechanics
|
|
|
|
|
updateDrowning(ptr, duration);
|
|
|
|
|
calculateNpcStatModifiers(ptr);
|
|
|
|
|
updateEquippedLight(ptr, duration);
|
|
|
|
|
updateSneak(ptr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -720,6 +721,28 @@ namespace MWMechanics
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Actors::updateSneak (const MWWorld::Ptr& ptr)
|
|
|
|
|
{
|
|
|
|
|
const MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
|
if (player.getClass().getCreatureStats(player).getMovementFlag(MWMechanics::CreatureStats::Flag_Sneak))
|
|
|
|
|
{
|
|
|
|
|
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
|
|
|
|
|
int radius = esmStore.get<ESM::GameSetting>().find("fSneakUseDist")->getInt();
|
|
|
|
|
|
|
|
|
|
// am I close enough to the player?
|
|
|
|
|
if (Ogre::Vector3(ptr.getRefData().getPosition().pos).squaredDistance(Ogre::Vector3(player.getRefData().getPosition().pos))
|
|
|
|
|
<= radius * radius )
|
|
|
|
|
{
|
|
|
|
|
bool seen = false; // unseen
|
|
|
|
|
if ( !MWBase::Environment::get().getMechanicsManager()->awarenessCheck(player, ptr)
|
|
|
|
|
&& !MWBase::Environment::get().getWorld()->getLOS(player, ptr) )
|
|
|
|
|
seen = true; // seen
|
|
|
|
|
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->setSneakVisibility(seen);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Actors::updateCrimePersuit(const MWWorld::Ptr& ptr, float duration)
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
|