mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-21 05:39:42 +00:00
Add missing function types.Item.isCarriable()
This commit is contained in:
parent
a297a0e742
commit
731095831d
1 changed files with 10 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
#include <components/esm3/loadligh.hpp>
|
||||
#include <sol/sol.hpp>
|
||||
|
||||
#include "../../mwmechanics/spellutil.hpp"
|
||||
|
@ -24,6 +25,15 @@ namespace MWLua
|
|||
item["isRestocking"]
|
||||
= [](const Object& object) -> bool { return object.ptr().getCellRef().getCount(false) < 0; };
|
||||
|
||||
item["isCarriable"] = [](const Object& object) -> bool {
|
||||
if (object.ptr().getClass().isItem(object.ptr()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return object.ptr().mRef->getType() == ESM::REC_LIGH
|
||||
&& (object.ptr().get<ESM::Light>()->mBase->mData.mFlags & ESM::Light::Carry) != 0;
|
||||
};
|
||||
|
||||
addItemDataBindings(item, context);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue