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

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

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

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

Loading…
Cancel
Save