[Client] Fix crash for invalid CellRefs in MechanicsHelper::getTarget()

0.6.3
David Cernat 7 years ago
parent 4b30a44816
commit 4eb72eecb1

@ -112,11 +112,16 @@ mwmp::Target MechanicsHelper::getTarget(const MWWorld::Ptr& ptr)
{
MWWorld::CellRef *ptrRef = &ptr.getCellRef();
target.isPlayer = false;
target.refId = ptrRef->getRefId();
target.refNumIndex = ptrRef->getRefNum().mIndex;
target.mpNum = ptrRef->getMpNum();
target.name = ptr.getClass().getName(ptr);
if (ptrRef)
{
target.isPlayer = false;
target.refId = ptrRef->getRefId();
target.refNumIndex = ptrRef->getRefNum().mIndex;
target.mpNum = ptrRef->getMpNum();
target.name = ptr.getClass().getName(ptr);
}
else
clearTarget(target);
}
return target;

Loading…
Cancel
Save