forked from teamnwah/openmw-tes3coop
Speed fix for "on target" spells
This commit is contained in:
parent
621e52f09d
commit
e9f63270d9
1 changed files with 4 additions and 5 deletions
|
@ -2174,14 +2174,13 @@ namespace MWWorld
|
|||
|
||||
Ogre::Vector3 rot(ptr.getRefData().getPosition().rot);
|
||||
|
||||
// TODO: Why -rot.z, but not -rot.x?
|
||||
// TODO: Why -rot.z, but not -rot.x? (note: same issue in MovementSolver::move)
|
||||
Ogre::Quaternion orient = Ogre::Quaternion(Ogre::Radian(-rot.z), Ogre::Vector3::UNIT_Z);
|
||||
orient = orient * Ogre::Quaternion(Ogre::Radian(rot.x), Ogre::Vector3::UNIT_X);
|
||||
|
||||
// This is just a guess, probably wrong
|
||||
static float fProjectileMinSpeed = getStore().get<ESM::GameSetting>().find("fProjectileMinSpeed")->getFloat();
|
||||
static float fProjectileMaxSpeed = getStore().get<ESM::GameSetting>().find("fProjectileMaxSpeed")->getFloat();
|
||||
float speed = fProjectileMinSpeed + (fProjectileMaxSpeed - fProjectileMinSpeed) * it->second.mSpeed;
|
||||
|
||||
static float fTargetSpellMaxSpeed = getStore().get<ESM::GameSetting>().find("fTargetSpellMaxSpeed")->getFloat();
|
||||
float speed = fTargetSpellMaxSpeed * it->second.mSpeed;
|
||||
|
||||
Ogre::Vector3 direction = orient.yAxis();
|
||||
direction.normalise();
|
||||
|
|
Loading…
Reference in a new issue