1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-13 07:14:31 +00:00

Merge remote branch 'scrawl/containerunlocking'

This commit is contained in:
Marc Zinnschlag 2012-06-18 09:57:22 +02:00
commit 09057daac5
2 changed files with 19 additions and 0 deletions

View File

@ -192,4 +192,17 @@ namespace MWClass
{
return getContainerStore (ptr).getWeight();
}
void Container::lock (const MWWorld::Ptr& ptr, int lockLevel) const
{
if (lockLevel<0)
lockLevel = 0;
ptr.getCellRef().lockLevel = lockLevel;
}
void Container::unlock (const MWWorld::Ptr& ptr) const
{
ptr.getCellRef().lockLevel = 0;
}
}

View File

@ -44,6 +44,12 @@ namespace MWClass
///< Returns total weight of objects inside this object (including modifications from magic
/// effects). Throws an exception, if the object can't hold other objects.
virtual void lock (const MWWorld::Ptr& ptr, int lockLevel) const;
///< Lock object
virtual void unlock (const MWWorld::Ptr& ptr) const;
///< Unlock object
static void registerSelf();
};
}