From f0c5d1a7e1eba636e3b0baa9ead6d00e70b059b3 Mon Sep 17 00:00:00 2001 From: Jeffrey Haines Date: Sat, 26 Apr 2014 10:03:56 -0400 Subject: [PATCH] Revert "Checks the state of the passed sneak variable" This reverts commit 4a4c08946c5b75701a5eb9b3e878c0727380909d. --- apps/openmw/mwworld/player.cpp | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/apps/openmw/mwworld/player.cpp b/apps/openmw/mwworld/player.cpp index 8588547d2..f4ca5ee27 100644 --- a/apps/openmw/mwworld/player.cpp +++ b/apps/openmw/mwworld/player.cpp @@ -134,25 +134,17 @@ namespace MWWorld ptr.getClass().getCreatureStats(ptr).setMovementFlag(MWMechanics::CreatureStats::Flag_Sneak, sneak); - 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 neighbors; - MWBase::Environment::get().getMechanicsManager()->getActorsInRange( Ogre::Vector3(ptr.getRefData().getPosition().pos), - esmStore.get().find("fSneakUseDist")->getInt(), neighbors); - for (std::vector::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); - } + const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore(); + + // Find all the actors who might be able to see the player + std::vector neighbors; + MWBase::Environment::get().getMechanicsManager()->getActorsInRange( Ogre::Vector3(ptr.getRefData().getPosition().pos), + esmStore.get().find("fSneakUseDist")->getInt(), neighbors); + for (std::vector::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); } void Player::yaw(float yaw)