forked from mirror/openmw-tes3mp
Forbid actors to use teleporting doors (bug #2562)
This commit is contained in:
parent
5a9e382efe
commit
2a65aaf5ab
2 changed files with 13 additions and 3 deletions
|
@ -4,6 +4,7 @@
|
||||||
Bug #1990: Sunrise/sunset not set correct
|
Bug #1990: Sunrise/sunset not set correct
|
||||||
Bug #2222: Fatigue's effect on selling price is backwards
|
Bug #2222: Fatigue's effect on selling price is backwards
|
||||||
Bug #2326: After a bound item expires the last equipped item of that type is not automatically re-equipped
|
Bug #2326: After a bound item expires the last equipped item of that type is not automatically re-equipped
|
||||||
|
Bug #2562: Forcing AI to activate a teleport door sometimes causes a crash
|
||||||
Bug #2835: Player able to slowly move when overencumbered
|
Bug #2835: Player able to slowly move when overencumbered
|
||||||
Bug #2971: Compiler did not reject lines with naked expressions beginning with x.y
|
Bug #2971: Compiler did not reject lines with naked expressions beginning with x.y
|
||||||
Bug #3374: Touch spells not hitting kwama foragers
|
Bug #3374: Touch spells not hitting kwama foragers
|
||||||
|
|
|
@ -121,14 +121,23 @@ namespace MWClass
|
||||||
bool hasKey = false;
|
bool hasKey = false;
|
||||||
std::string keyName;
|
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, how in 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
|
// 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()->getDistanceToFacedObject() >
|
||||||
MWBase::Environment::get().getWorld()->getMaxActivationDistance())
|
MWBase::Environment::get().getWorld()->getMaxActivationDistance())
|
||||||
{
|
{
|
||||||
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(ptr);
|
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(ptr);
|
||||||
|
|
||||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
int index = ESM::MagicEffect::effectStringToId("sEffectTelekinesis");
|
int index = ESM::MagicEffect::effectStringToId("sEffectTelekinesis");
|
||||||
const ESM::MagicEffect *effect = store.get<ESM::MagicEffect>().find(index);
|
const ESM::MagicEffect *effect = store.get<ESM::MagicEffect>().find(index);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue