Remove redundant player cell variable

pull/303/head
scrawl 7 years ago
parent 84657271c7
commit bbafe1e456

@ -1,14 +1,8 @@
#include "referenceinterface.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwmechanics/actorutil.hpp"
namespace MWGui
{
ReferenceInterface::ReferenceInterface()
: mCurrentPlayerCell(NULL)
{
}
@ -18,8 +12,6 @@ namespace MWGui
void ReferenceInterface::checkReferenceAvailable()
{
MWWorld::CellStore* playerCell = MWMechanics::getPlayer().getCell();
// check if count of the reference has become 0
if (!mPtr.isEmpty() && mPtr.getRefData().getCount() == 0)
{
@ -29,7 +21,5 @@ namespace MWGui
onReferenceUnavailable();
}
}
mCurrentPlayerCell = playerCell;
}
}

@ -17,15 +17,12 @@ namespace MWGui
void checkReferenceAvailable(); ///< closes the window, if the MW-reference has become unavailable
virtual void resetReference() { mPtr = MWWorld::Ptr(); mCurrentPlayerCell = NULL; }
virtual void resetReference() { mPtr = MWWorld::Ptr(); }
protected:
virtual void onReferenceUnavailable() = 0; ///< called when reference has become unavailable
MWWorld::Ptr mPtr;
private:
MWWorld::CellStore* mCurrentPlayerCell;
};
}

Loading…
Cancel
Save