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,13 +146,20 @@ namespace MWClass
|
|||
|
||||
if (ptr.getCellRef().getTeleport())
|
||||
{
|
||||
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTeleport (ptr.getCellRef().getDestCell(), ptr.getCellRef().getDoorDest(), true));
|
||||
|
||||
action->setSound(openSound);
|
||||
|
||||
if (actor == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->getDistanceToFacedObject() > MWBase::Environment::get().getWorld()->getMaxActivationDistance())
|
||||
{
|
||||
// player activated teleport door with telekinesis
|
||||
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction);
|
||||
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
|
||||
{
|
||||
// animated door
|
||||
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionDoor(ptr));
|
||||
|
@ -215,7 +222,7 @@ namespace MWClass
|
|||
|
||||
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;
|
||||
else
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue