Add function for converting feet to game units

actorid
scrawl 11 years ago
parent f6387d5979
commit 24aa743573

@ -1325,7 +1325,8 @@ namespace MWWorld
{
float telekinesisRangeBonus =
mPlayer->getPlayer().getClass().getCreatureStats(mPlayer->getPlayer()).getMagicEffects()
.get(ESM::MagicEffect::Telekinesis).mMagnitude * 22;
.get(ESM::MagicEffect::Telekinesis).mMagnitude;
telekinesisRangeBonus = feetToGameUnits(telekinesisRangeBonus);
float activationDistance = getMaxActivationDistance() + telekinesisRangeBonus;
@ -2396,8 +2397,7 @@ namespace MWWorld
if (!dist)
return;
// TODO: "1 foot" = 20 game units?
dist *= 20;
dist = feetToGameUnits(dist);
AddDetectedReference functor (out, ptr, type, dist*dist);
@ -2408,4 +2408,11 @@ namespace MWWorld
cellStore->forEach(functor);
}
}
float World::feetToGameUnits(float feet)
{
// Looks like there is no GMST for this. This factor was determined in experiments
// with the Telekinesis effect.
return feet * 22;
}
}

@ -155,6 +155,8 @@ namespace MWWorld
/// Called when \a object is moved to an inactive cell
void objectLeftActiveCell (MWWorld::Ptr object, MWWorld::Ptr movedPtr);
float feetToGameUnits(float feet);
public:
World (OEngine::Render::OgreRenderer& renderer,

Loading…
Cancel
Save