mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +00:00
Add function for converting feet to game units
This commit is contained in:
parent
f6387d5979
commit
24aa743573
2 changed files with 12 additions and 3 deletions
|
@ -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…
Reference in a new issue