diff --git a/CHANGELOG.md b/CHANGELOG.md index 49c0f3ef3..7a958fbc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,6 +87,7 @@ Bug #4413: Moving with 0 strength uses all of your fatigue Bug #4420: Camera flickering when I open up and close menus while sneaking Bug #4435: Item health is considered a signed integer + Bug #4441: Adding items to currently disabled weapon-wielding creatures crashes the game Feature #1786: Round up encumbrance value in the encumbrance bar Feature #2694: Editor: rename "model" column to make its purpose clear Feature #3870: Editor: Terrain Texture Brush Button diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp index f0a3d2e38..db6772eaa 100644 --- a/apps/openmw/mwrender/objects.cpp +++ b/apps/openmw/mwrender/objects.cpp @@ -123,11 +123,12 @@ bool Objects::removeObject (const MWWorld::Ptr& ptr) mObjects.erase(iter); - if (ptr.getClass().isNpc()) + if (ptr.getClass().isActor()) { - MWWorld::InventoryStore& store = ptr.getClass().getInventoryStore(ptr); - store.setInvListener(NULL, ptr); - store.setContListener(NULL); + if (ptr.getClass().hasInventoryStore(ptr)) + ptr.getClass().getInventoryStore(ptr).setInvListener(NULL, ptr); + + ptr.getClass().getContainerStore(ptr).setContListener(NULL); } ptr.getRefData().getBaseNode()->getParent(0)->removeChild(ptr.getRefData().getBaseNode());