mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 12:53:53 +00:00
Fix crash when adding items to certain disabled creatures (bug #4441)
This commit is contained in:
parent
7605d928db
commit
04a2025340
1 changed files with 5 additions and 4 deletions
|
@ -123,11 +123,12 @@ bool Objects::removeObject (const MWWorld::Ptr& ptr)
|
||||||
|
|
||||||
mObjects.erase(iter);
|
mObjects.erase(iter);
|
||||||
|
|
||||||
if (ptr.getClass().isNpc())
|
if (ptr.getClass().isActor())
|
||||||
{
|
{
|
||||||
MWWorld::InventoryStore& store = ptr.getClass().getInventoryStore(ptr);
|
if (ptr.getClass().hasInventoryStore(ptr))
|
||||||
store.setInvListener(NULL, ptr);
|
ptr.getClass().getInventoryStore(ptr).setInvListener(NULL, ptr);
|
||||||
store.setContListener(NULL);
|
|
||||||
|
ptr.getClass().getContainerStore(ptr).setContListener(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr.getRefData().getBaseNode()->getParent(0)->removeChild(ptr.getRefData().getBaseNode());
|
ptr.getRefData().getBaseNode()->getParent(0)->removeChild(ptr.getRefData().getBaseNode());
|
||||||
|
|
Loading…
Reference in a new issue