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 cc346c2345..710348ac4b 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -5872,12 +5872,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;
@@ -5895,9 +5893,9 @@ void LLVoiceClient::updatePosition(void)
rot); // rotation matrix
// Send the current avatar position to the voice code
- rot = avatarp->getRootJoint()->getWorldRotation().getMatrix3();
+ rot = gAgentAvatar->getRootJoint()->getWorldRotation().getMatrix3();
- pos = avatarp->getPositionGlobal();
+ pos = gAgentAvatar->getPositionGlobal();
// TODO: Can we get the head offset from outside the LLVOAvatar?
// pos += LLVector3d(mHeadOffset);
pos += LLVector3d(0.f, 0.f, 1.f);