mirror of https://github.com/OpenMW/openmw.git
[Lua] Split obj.inventory into Actor.inventory(obj) and Container.content(obj)
parent
d251c4e2a1
commit
43bed7f0d2
@ -0,0 +1,18 @@
|
||||
#include "types.hpp"
|
||||
|
||||
#include "../luabindings.hpp"
|
||||
|
||||
namespace MWLua
|
||||
{
|
||||
|
||||
static const MWWorld::Ptr& containerPtr(const Object& o) { return verifyType(ESM::REC_CONT, o.ptr()); }
|
||||
|
||||
void addContainerBindings(sol::table container, const Context& context)
|
||||
{
|
||||
container["content"] = sol::overload(
|
||||
[](const LObject& o) { containerPtr(o); return Inventory<LObject>{o}; },
|
||||
[](const GObject& o) { containerPtr(o); return Inventory<GObject>{o}; }
|
||||
);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue