|
|
|
@ -121,8 +121,17 @@ namespace MWClass
|
|
|
|
|
bool hasKey = false;
|
|
|
|
|
std::string keyName;
|
|
|
|
|
|
|
|
|
|
// FIXME: If NPC activate teleporting door, it can lead to crash due to iterator invalidation in the Actors update.
|
|
|
|
|
// Make such activation a no-op for now, like how it is in the vanilla game.
|
|
|
|
|
if (actor != MWMechanics::getPlayer() && ptr.getCellRef().getTeleport())
|
|
|
|
|
{
|
|
|
|
|
std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction(std::string(), ptr));
|
|
|
|
|
action->setSound(lockedSound);
|
|
|
|
|
return action;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// make door glow if player activates it with telekinesis
|
|
|
|
|
if (actor == MWBase::Environment::get().getWorld()->getPlayerPtr() &&
|
|
|
|
|
if (actor == MWMechanics::getPlayer() &&
|
|
|
|
|
MWBase::Environment::get().getWorld()->getDistanceToFacedObject() >
|
|
|
|
|
MWBase::Environment::get().getWorld()->getMaxActivationDistance())
|
|
|
|
|
{
|
|
|
|
|