From 498530fad7244b8fe39f96003ab676f344a99bc7 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 18 May 2012 22:24:19 +0200 Subject: [PATCH] container iterator fix --- apps/openmw/mwworld/containerstore.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp index ee1b620cd..44eb0ac70 100644 --- a/apps/openmw/mwworld/containerstore.cpp +++ b/apps/openmw/mwworld/containerstore.cpp @@ -228,6 +228,11 @@ MWWorld::ContainerStoreIterator::ContainerStoreIterator (int mask, ContainerStor : mType (0), mMask (mask), mContainer (container) { nextType(); + + if (mType==-1 || (**this).getRefData().getCount()) + return; + + ++*this; } void MWWorld::ContainerStoreIterator::incType() @@ -249,7 +254,7 @@ void MWWorld::ContainerStoreIterator::nextType() { incType(); - if (mType & mMask) + if ((mType & mMask) && mType>0) if (resetIterator()) break; }