forked from mirror/openmw-tes3mp
allow the 'lock' and 'unlock' script commands to work on containers, like in morrowind
This commit is contained in:
parent
447158e9d6
commit
de3daf3dc1
2 changed files with 19 additions and 0 deletions
|
@ -192,4 +192,17 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
return getContainerStore (ptr).getWeight();
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,12 @@ namespace MWClass
|
||||||
///< Returns total weight of objects inside this object (including modifications from magic
|
///< Returns total weight of objects inside this object (including modifications from magic
|
||||||
/// effects). Throws an exception, if the object can't hold other objects.
|
/// 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();
|
static void registerSelf();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue