pull/1/head
Allofich 9 years ago
parent cb621939fd
commit 7de3afaa7d

@ -21,7 +21,7 @@ namespace MWWorld
{ {
MWMechanics::CastSpell cast(mTrapSource, mTrapSource); MWMechanics::CastSpell cast(mTrapSource, mTrapSource);
cast.mHitPosition = trapPosition; cast.mHitPosition = trapPosition;
cast.cast(mSpellId); cast.cast(mSpellId);
} }
else // actor activated object within range of trap else // actor activated object within range of trap
{ {

@ -13,7 +13,7 @@ namespace MWWorld
std::string mSpellId; std::string mSpellId;
MWWorld::Ptr mTrapSource; MWWorld::Ptr mTrapSource;
virtual void executeImp (const Ptr& actor, float distanceToObject = -1); virtual void executeImp (const Ptr& actor, float distanceToObject);
public: public:

@ -150,7 +150,7 @@ namespace MWWorld
mSky (true), mCells (mStore, mEsm), mSky (true), mCells (mStore, mEsm),
mGodMode(false), mScriptsEnabled(true), mContentFiles (contentFiles), mGodMode(false), mScriptsEnabled(true), mContentFiles (contentFiles),
mActivationDistanceOverride (activationDistanceOverride), mStartupScript(startupScript), mActivationDistanceOverride (activationDistanceOverride), mStartupScript(startupScript),
mStartCell (startCell), mDistanceToFacedObject(0), mTeleportEnabled(true), mStartCell (startCell), mDistanceToFacedObject(-1), mTeleportEnabled(true),
mLevitationEnabled(true), mGoToJail(false), mDaysInPrison(0) mLevitationEnabled(true), mGoToJail(false), mDaysInPrison(0)
{ {
mPhysics = new MWPhysics::PhysicsSystem(resourceSystem, rootNode); mPhysics = new MWPhysics::PhysicsSystem(resourceSystem, rootNode);
@ -1011,11 +1011,10 @@ namespace MWWorld
MWWorld::Ptr World::getFacedObject() MWWorld::Ptr World::getFacedObject()
{ {
MWWorld::Ptr facedObject; MWWorld::Ptr facedObject;
float distanceToObject;
if (MWBase::Environment::get().getWindowManager()->isGuiMode() && if (MWBase::Environment::get().getWindowManager()->isGuiMode() &&
MWBase::Environment::get().getWindowManager()->isConsoleMode()) MWBase::Environment::get().getWindowManager()->isConsoleMode())
facedObject = getFacedObject(getMaxActivationDistance() * 50, distanceToObject, false); facedObject = getFacedObject(getMaxActivationDistance() * 50, mDistanceToFacedObject, false);
else else
{ {
float telekinesisRangeBonus = float telekinesisRangeBonus =
@ -1025,14 +1024,12 @@ namespace MWWorld
float activationDistance = getMaxActivationDistance() + telekinesisRangeBonus; float activationDistance = getMaxActivationDistance() + telekinesisRangeBonus;
facedObject = getFacedObject(activationDistance, distanceToObject, true); facedObject = getFacedObject(activationDistance, mDistanceToFacedObject, true);
if (!facedObject.isEmpty() && !facedObject.getClass().allowTelekinesis(facedObject) if (!facedObject.isEmpty() && !facedObject.getClass().allowTelekinesis(facedObject)
&& distanceToObject > getMaxActivationDistance()) && mDistanceToFacedObject > getMaxActivationDistance())
return 0; return 0;
} }
mDistanceToFacedObject = distanceToObject;
return facedObject; return facedObject;
} }
@ -1733,6 +1730,8 @@ namespace MWWorld
facedObject = rayToObject.mHitObject; facedObject = rayToObject.mHitObject;
if (!facedObject.isEmpty()) if (!facedObject.isEmpty())
distance = rayToObject.mRatio * maxDistance; distance = rayToObject.mRatio * maxDistance;
else
distance = -1;
return facedObject; return facedObject;
} }

Loading…
Cancel
Save