forked from teamnwah/openmw-tes3coop
Allow some telekinesis on teleport doors
This commit is contained in:
parent
4e54338ce0
commit
53ceefa46a
1 changed files with 13 additions and 6 deletions
|
@ -146,11 +146,18 @@ namespace MWClass
|
||||||
|
|
||||||
if (ptr.getCellRef().getTeleport())
|
if (ptr.getCellRef().getTeleport())
|
||||||
{
|
{
|
||||||
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTeleport (ptr.getCellRef().getDestCell(), ptr.getCellRef().getDoorDest(), true));
|
if (actor == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->getDistanceToFacedObject() > MWBase::Environment::get().getWorld()->getMaxActivationDistance())
|
||||||
|
{
|
||||||
action->setSound(openSound);
|
// player activated teleport door with telekinesis
|
||||||
|
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction);
|
||||||
return action;
|
return action;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTeleport (ptr.getCellRef().getDestCell(), ptr.getCellRef().getDoorDest(), true));
|
||||||
|
action->setSound(openSound);
|
||||||
|
return action;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -215,7 +222,7 @@ namespace MWClass
|
||||||
|
|
||||||
bool Door::allowTelekinesis(const MWWorld::ConstPtr &ptr) const
|
bool Door::allowTelekinesis(const MWWorld::ConstPtr &ptr) const
|
||||||
{
|
{
|
||||||
if (ptr.getCellRef().getTeleport())
|
if (ptr.getCellRef().getTeleport() && ptr.getCellRef().getLockLevel() <= 0 && ptr.getCellRef().getTrap().empty())
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue