if(target.isEmpty()||!target.getRefData().getCount()||!target.getRefData().isEnabled()// Really we should be checking whether the target is currently registered
// with the MechanicsManager
)
returntrue;//Target doesn't exist
// Only the player can be actively followed. AiFollow packages with targets other than the player
ESM::Positionpos=actor.getRefData().getPosition();//position of the actor
constMWWorld::Ptrtarget=MWBase::Environment::get().getWorld()->searchPtrViaActorId(mTargetActorId);//The target to follow
if(target==MWWorld::Ptr())
if(target==MWWorld::Ptr()||!target.getRefData().getCount()||!target.getRefData().isEnabled()// Really we should be checking whether the target is currently registered