From 4344dc6e00431af0be7c2d289bf1217f97628f46 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Tue, 5 Aug 2025 19:10:48 +0200 Subject: [PATCH] Don't init custom data when checking container resolution --- CMakeLists.txt | 2 +- apps/openmw/mwlua/objectbindings.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5991c57c4c..c0d09542f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ message(STATUS "Configuring OpenMW...") set(OPENMW_VERSION_MAJOR 0) set(OPENMW_VERSION_MINOR 50) set(OPENMW_VERSION_RELEASE 0) -set(OPENMW_LUA_API_REVISION 88) +set(OPENMW_LUA_API_REVISION 89) set(OPENMW_POSTPROCESSING_API_REVISION 3) set(OPENMW_VERSION_COMMITHASH "") diff --git a/apps/openmw/mwlua/objectbindings.cpp b/apps/openmw/mwlua/objectbindings.cpp index 3508fdcd44..0a73acfc42 100644 --- a/apps/openmw/mwlua/objectbindings.cpp +++ b/apps/openmw/mwlua/objectbindings.cpp @@ -645,6 +645,9 @@ namespace MWLua } inventoryT["isResolved"] = [](const InventoryT& inventory) -> bool { const MWWorld::Ptr& ptr = inventory.mObj.ptr(); + // Avoid initializing custom data + if (!ptr.getRefData().getCustomData()) + return false; MWWorld::ContainerStore& store = ptr.getClass().getContainerStore(ptr); return store.isResolved(); };