|
|
|
@ -193,7 +193,7 @@ namespace MWClass
|
|
|
|
|
std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTeleport (ptr.getCellRef().getDestCell(), ptr.getCellRef().getDoorDest(), true));
|
|
|
|
|
action->setSound(openSound);
|
|
|
|
|
return action;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -240,15 +240,16 @@ namespace MWClass
|
|
|
|
|
|
|
|
|
|
void Door::lock (const MWWorld::Ptr& ptr, int lockLevel) const
|
|
|
|
|
{
|
|
|
|
|
if(lockLevel!=0)
|
|
|
|
|
ptr.getCellRef().setLockLevel(abs(lockLevel)); //Changes lock to locklevel, in positive
|
|
|
|
|
if(lockLevel != 0)
|
|
|
|
|
ptr.getCellRef().setLockLevel(abs(lockLevel)); //Changes lock to locklevel, if positive
|
|
|
|
|
else
|
|
|
|
|
ptr.getCellRef().setLockLevel(abs(ptr.getCellRef().getLockLevel())); //No locklevel given, just flip the original one
|
|
|
|
|
ptr.getCellRef().setLockLevel(ESM::UnbreakableLock); // If zero, set to max lock level
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Door::unlock (const MWWorld::Ptr& ptr) const
|
|
|
|
|
{
|
|
|
|
|
ptr.getCellRef().setLockLevel(-abs(ptr.getCellRef().getLockLevel())); //Makes lockLevel negative
|
|
|
|
|
int lockLevel = ptr.getCellRef().getLockLevel();
|
|
|
|
|
ptr.getCellRef().setLockLevel(-abs(lockLevel)); //Makes lockLevel negative
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Door::canLock(const MWWorld::ConstPtr &ptr) const
|
|
|
|
@ -300,7 +301,8 @@ namespace MWClass
|
|
|
|
|
text += "\n" + getDestination(*ref);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ptr.getCellRef().getLockLevel() > 0)
|
|
|
|
|
int lockLevel = ptr.getCellRef().getLockLevel();
|
|
|
|
|
if (lockLevel > 0 && lockLevel != ESM::UnbreakableLock)
|
|
|
|
|
text += "\n#{sLockLevel}: " + MWGui::ToolTips::toString(ptr.getCellRef().getLockLevel());
|
|
|
|
|
else if (ptr.getCellRef().getLockLevel() < 0)
|
|
|
|
|
text += "\n#{sUnlocked}";
|
|
|
|
|