mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 02:45:31 +00:00
Checks the state of the passed sneak variable
This commit is contained in:
parent
42b879a9a5
commit
4a4c08946c
1 changed files with 18 additions and 10 deletions
|
@ -134,17 +134,25 @@ namespace MWWorld
|
|||
|
||||
ptr.getClass().getCreatureStats(ptr).setMovementFlag(MWMechanics::CreatureStats::Flag_Sneak, sneak);
|
||||
|
||||
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
|
||||
if (sneak == true)
|
||||
{
|
||||
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
// Find all the actors who might be able to see the player
|
||||
std::vector<MWWorld::Ptr> neighbors;
|
||||
MWBase::Environment::get().getMechanicsManager()->getActorsInRange( Ogre::Vector3(ptr.getRefData().getPosition().pos),
|
||||
esmStore.get<ESM::GameSetting>().find("fSneakUseDist")->getInt(), neighbors);
|
||||
for (std::vector<MWWorld::Ptr>::iterator it = neighbors.begin(); it != neighbors.end(); ++it)
|
||||
if ( MWBase::Environment::get().getMechanicsManager()->awarenessCheck(ptr, *it) )
|
||||
MWBase::Environment::get().getWindowManager()->setSneakVisibility(sneak);
|
||||
if (!neighbors.size())
|
||||
MWBase::Environment::get().getWindowManager()->setSneakVisibility(sneak);
|
||||
// Find all the actors who might be able to see the player
|
||||
std::vector<MWWorld::Ptr> neighbors;
|
||||
MWBase::Environment::get().getMechanicsManager()->getActorsInRange( Ogre::Vector3(ptr.getRefData().getPosition().pos),
|
||||
esmStore.get<ESM::GameSetting>().find("fSneakUseDist")->getInt(), neighbors);
|
||||
for (std::vector<MWWorld::Ptr>::iterator it = neighbors.begin(); it != neighbors.end(); ++it)
|
||||
{
|
||||
if ( MWBase::Environment::get().getMechanicsManager()->awarenessCheck(ptr, *it) )
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->setSneakVisibility(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (neighbors.size() == 0)
|
||||
MWBase::Environment::get().getWindowManager()->setSneakVisibility(true);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::yaw(float yaw)
|
||||
|
|
Loading…
Reference in a new issue