forked from teamnwah/openmw-tes3coop
Removed initial check form setSneak
It wasn’t needed.
This commit is contained in:
parent
05e326bdc3
commit
e1e23447f2
2 changed files with 11 additions and 33 deletions
|
@ -728,18 +728,16 @@ namespace MWMechanics
|
|||
{
|
||||
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
|
||||
bool seen = false;
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setSneakVisibility(seen);
|
||||
}
|
||||
// am I close enough and can I see the player?
|
||||
if ( (Ogre::Vector3(ptr.getRefData().getPosition().pos).squaredDistance(Ogre::Vector3(player.getRefData().getPosition().pos)) <= radius*radius)
|
||||
&& MWBase::Environment::get().getMechanicsManager()->awarenessCheck(player, ptr)
|
||||
&& MWBase::Environment::get().getWorld()->getLOS(player, ptr))
|
||||
|
||||
seen = true;
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setSneakVisibility(seen);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -132,28 +132,8 @@ namespace MWWorld
|
|||
MWWorld::Ptr ptr = getPlayer();
|
||||
ptr.getClass().getCreatureStats(ptr).setMovementFlag(MWMechanics::CreatureStats::Flag_Sneak, sneak);
|
||||
|
||||
if (sneak)
|
||||
{
|
||||
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 (*it == ptr) // not the player
|
||||
continue;
|
||||
|
||||
if ( MWBase::Environment::get().getMechanicsManager()->awarenessCheck(ptr, *it) )
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->setSneakVisibility(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (neighbors.empty())
|
||||
MWBase::Environment::get().getWindowManager()->setSneakVisibility(true);
|
||||
}
|
||||
if(!sneak)
|
||||
MWBase::Environment::get().getWindowManager()->setSneakVisibility(false);
|
||||
}
|
||||
|
||||
void Player::yaw(float yaw)
|
||||
|
|
Loading…
Reference in a new issue