mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:53:52 +00:00
Cleanups
This commit is contained in:
parent
cb621939fd
commit
7de3afaa7d
3 changed files with 8 additions and 9 deletions
|
@ -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…
Reference in a new issue