mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 22:40:12 +00:00
Add glow when using telekinesis on doors
This commit is contained in:
parent
57138b416e
commit
123c626f2d
1 changed files with 19 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "../mwrender/objects.hpp"
|
||||
#include "../mwrender/renderinginterface.hpp"
|
||||
#include "../mwrender/animation.hpp"
|
||||
|
||||
#include "../mwmechanics/actorutil.hpp"
|
||||
|
||||
|
@ -112,6 +113,24 @@ namespace MWClass
|
|||
bool hasKey = false;
|
||||
std::string keyName;
|
||||
|
||||
if (actor == MWBase::Environment::get().getWorld()->getPlayerPtr() && // assuming player is using telekinesis
|
||||
MWBase::Environment::get().getWorld()->getDistanceToFacedObject() >
|
||||
MWBase::Environment::get().getWorld()->getMaxActivationDistance())
|
||||
{
|
||||
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(ptr);
|
||||
|
||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::MagicEffect *effect;
|
||||
effect = store.get<ESM::MagicEffect>().find(59);
|
||||
|
||||
osg::Vec4f glowcolor(1,1,1,1);
|
||||
glowcolor.x() = effect->mData.mRed / 255.f;
|
||||
glowcolor.y() = effect->mData.mGreen / 255.f;
|
||||
glowcolor.z() = effect->mData.mBlue / 255.f;
|
||||
|
||||
animation->addSpellCastGlow(glowcolor); // TODO: Telekinesis glow should only be as long as the door animation
|
||||
}
|
||||
|
||||
// make key id lowercase
|
||||
std::string keyId = ptr.getCellRef().getKey();
|
||||
Misc::StringUtils::lowerCaseInPlace(keyId);
|
||||
|
|
Loading…
Reference in a new issue