summaryrefslogtreecommitdiff
path: root/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
-rw-r--r--indra/newview/llvoiceclient.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 3bfb898a1e..d8319f3cc3 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -5948,12 +5948,10 @@ void LLVoiceClient::enforceTether(void)
void LLVoiceClient::updatePosition(void)
{
-
if(gVoiceClient)
{
- LLVOAvatarSelf *avatarp = gAgent.getAvatarObject();
LLViewerRegion *region = gAgent.getRegion();
- if(region && avatarp)
+ if(region && isAgentAvatarValid())
{
LLMatrix3 rot;
LLVector3d pos;
@@ -5971,9 +5969,9 @@ void LLVoiceClient::updatePosition(void)
rot); // rotation matrix
// Send the current avatar position to the voice code
- rot = avatarp->getRootJoint()->getWorldRotation().getMatrix3();
+ rot = gAgentAvatarp->getRootJoint()->getWorldRotation().getMatrix3();
- pos = avatarp->getPositionGlobal();
+ pos = gAgentAvatarp->getPositionGlobal();
// TODO: Can we get the head offset from outside the LLVOAvatar?
// pos += LLVector3d(mHeadOffset);
pos += LLVector3d(0.f, 0.f, 1.f);