You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
788 B
C++
36 lines
788 B
C++
#include "referenceinterface.hpp"
|
|
|
|
#include "../mwbase/world.hpp"
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
#include "../mwmechanics/actorutil.hpp"
|
|
|
|
namespace MWGui
|
|
{
|
|
ReferenceInterface::ReferenceInterface()
|
|
: mCurrentPlayerCell(NULL)
|
|
{
|
|
}
|
|
|
|
ReferenceInterface::~ReferenceInterface()
|
|
{
|
|
}
|
|
|
|
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)
|
|
{
|
|
if (!mPtr.isEmpty())
|
|
{
|
|
mPtr = MWWorld::Ptr();
|
|
onReferenceUnavailable();
|
|
}
|
|
}
|
|
|
|
mCurrentPlayerCell = playerCell;
|
|
}
|
|
}
|