|
|
@ -181,7 +181,7 @@ namespace MWClass
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MWBase::Environment::get().getWindowManager ()->messageBox (keyName + " #{sKeyUsed}");
|
|
|
|
MWBase::Environment::get().getWindowManager ()->messageBox (keyName + " #{sKeyUsed}");
|
|
|
|
if(isLocked)
|
|
|
|
if(isLocked)
|
|
|
|
unlock(ptr);
|
|
|
|
ptr.getCellRef().unlock();
|
|
|
|
// using a key disarms the trap
|
|
|
|
// using a key disarms the trap
|
|
|
|
if(isTrapped)
|
|
|
|
if(isTrapped)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -300,23 +300,10 @@ namespace MWClass
|
|
|
|
return getContainerStore (ptr).getWeight();
|
|
|
|
return getContainerStore (ptr).getWeight();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Container::lock (const MWWorld::Ptr& ptr, int lockLevel) const
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(lockLevel != 0)
|
|
|
|
|
|
|
|
ptr.getCellRef().setLockLevel(abs(lockLevel)); //Changes lock to locklevel, if positive
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
ptr.getCellRef().setLockLevel(ESM::UnbreakableLock); // If zero, set to max lock level
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Container::unlock (const MWWorld::Ptr& ptr) const
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int lockLevel = ptr.getCellRef().getLockLevel();
|
|
|
|
|
|
|
|
ptr.getCellRef().setLockLevel(-abs(lockLevel)); //Makes lockLevel negative
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Container::canLock(const MWWorld::ConstPtr &ptr) const
|
|
|
|
bool Container::canLock(const MWWorld::ConstPtr &ptr) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
const MWWorld::LiveCellRef<ESM::Container> *ref = ptr.get<ESM::Container>();
|
|
|
|
|
|
|
|
return !(ref->mBase->mFlags & ESM::Container::Organic);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MWWorld::Ptr Container::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
|
|
|
MWWorld::Ptr Container::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
|
|
|