summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r--indra/newview/llvoicevivox.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index bf09cdef37..2f3bd567da 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -4950,9 +4950,8 @@ void LLVivoxVoiceClient::enforceTether(void)
void LLVivoxVoiceClient::updatePosition(void)
{
- LLVOAvatarSelf *agent = gAgent.getAvatarObject();
LLViewerRegion *region = gAgent.getRegion();
- if(region && agent)
+ if(region && isAgentAvatarValid())
{
LLMatrix3 rot;
LLVector3d pos;
@@ -4970,9 +4969,9 @@ void LLVivoxVoiceClient::updatePosition(void)
rot); // rotation matrix
// Send the current avatar position to the voice code
- rot = agent->getRootJoint()->getWorldRotation().getMatrix3();
-
- pos = agent->getPositionGlobal();
+ rot = gAgentAvatarp->getRootJoint()->getWorldRotation().getMatrix3();
+ 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);