Whoops, fixup locally experienced crash with lookat beacons.

This commit is contained in:
Lirusaito
2014-05-25 14:47:45 -04:00
parent ea9005868b
commit d372fa1a0f

View File

@@ -550,8 +550,8 @@ void LLHUDEffectLookAt::render()
static const LLCachedControl<S32> lookAtNames("LookAtNameSystem");
if (lookAtNames < 0) return;
std::string text;
LLAvatarNameCache::getPNSName(static_cast<LLVOAvatar*>(mSourceObject.get())->getID(), text, lookAtNames);
if (0 == text.compare(text.length() - 9, 9, " Resident"))
if (!LLAvatarNameCache::getPNSName(static_cast<LLVOAvatar*>(mSourceObject.get())->getID(), text, lookAtNames)) return;
if (text.length() > 9 && 0 == text.compare(text.length() - 9, 9, " Resident"))
text.erase(text.length() - 9);
LLVector3 offset = gAgentCamera.getCameraPositionAgent() - target;
offset.normalize();