Merge remote-tracking branch 'scrawl/master'

This commit is contained in:
Marc Zinnschlag 2013-04-22 09:52:24 +02:00
commit 3fa35af796

View file

@ -18,17 +18,17 @@ namespace MWGui
void ReferenceInterface::checkReferenceAvailable() void ReferenceInterface::checkReferenceAvailable()
{ {
if (mPtr.isEmpty())
return;
MWWorld::Ptr::CellStore* playerCell = MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell(); MWWorld::Ptr::CellStore* playerCell = MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell();
// check if player has changed cell, or count of the reference has become 0 // check if player has changed cell, or count of the reference has become 0
if ((playerCell != mCurrentPlayerCell && mCurrentPlayerCell != NULL) if ((playerCell != mCurrentPlayerCell && mCurrentPlayerCell != NULL)
|| mPtr.getRefData().getCount() == 0) || (!mPtr.isEmpty() && mPtr.getRefData().getCount() == 0))
{ {
mPtr = MWWorld::Ptr(); if (!mPtr.isEmpty())
onReferenceUnavailable(); {
mPtr = MWWorld::Ptr();
onReferenceUnavailable();
}
} }
mCurrentPlayerCell = playerCell; mCurrentPlayerCell = playerCell;