diff --git a/CHANGELOG.md b/CHANGELOG.md index ce530dfe3d..988106734b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -246,6 +246,7 @@ Feature #7964: Add Lua read access to MW Dialogue records Feature #7971: Make save's Time Played value display hours instead of days Feature #7985: Support dark mode on Windows + Feature #8034: (Lua) Containers should have respawning/organic flags Task #5896: Do not use deprecated MyGUI properties Task #6085: Replace boost::filesystem with std::filesystem Task #6149: Dehardcode Lua API_REVISION diff --git a/apps/openmw/mwlua/types/container.cpp b/apps/openmw/mwlua/types/container.cpp index 332cf6ac2e..55f3e4a10e 100644 --- a/apps/openmw/mwlua/types/container.cpp +++ b/apps/openmw/mwlua/types/container.cpp @@ -54,5 +54,9 @@ namespace MWLua record["mwscript"] = sol::readonly_property( [](const ESM::Container& rec) -> std::string { return rec.mScript.serializeText(); }); record["weight"] = sol::readonly_property([](const ESM::Container& rec) -> float { return rec.mWeight; }); + record["isOrganic"] = sol::readonly_property( + [](const ESM::Container& rec) -> bool { return rec.mFlags & ESM::Container::Organic; }); + record["isRespawning"] = sol::readonly_property( + [](const ESM::Container& rec) -> bool { return rec.mFlags & ESM::Container::Respawn; }); } } diff --git a/files/lua_api/openmw/types.lua b/files/lua_api/openmw/types.lua index 39a3df579a..1e0b486524 100644 --- a/files/lua_api/openmw/types.lua +++ b/files/lua_api/openmw/types.lua @@ -2109,7 +2109,8 @@ -- @field #string model VFS path to the model -- @field #string mwscript MWScript on this container (can be empty) -- @field #number weight capacity of this container - +-- @field #boolean isOrganic Whether items can be placed in the container +-- @field #boolean isRespawning Whether the container respawns its contents -------------------------------------------------------------------------------- -- @{#Door} functions