forked from mirror/openmw-tes3mp
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);
|
||||
|
||||
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());
|
||||
|
|
Loading…
Reference in a new issue