summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolpie.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-03-26 14:33:48 -0400
committerLoren Shih <seraph@lindenlab.com>2010-03-26 14:33:48 -0400
commit46fe5d49caef6c8db3df9d88f0d0ec773ef28095 (patch)
tree87f8ae2f01d871b23b9d1c1ef9f9ce736dbc8c98 /indra/newview/lltoolpie.cpp
parent0bcfbde3a4265d7963ea501622e512de8eab7f61 (diff)
EXT-6536 : Make LLVOAvatarSelf a singleton
Superficial cleanup so that all instances of gAgent.getAvatarObject() use "LLVOAvatarSelf *avatarp = gAgent.getAvatarObject".
Diffstat (limited to 'indra/newview/lltoolpie.cpp')
-rw-r--r--indra/newview/lltoolpie.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 8d4f0f9116..c80db89ef0 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -205,15 +205,16 @@ BOOL LLToolPie::pickLeftMouseDownCallback()
// touch behavior down below...
break;
case CLICK_ACTION_SIT:
-
- if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->isSitting())) // agent not already sitting
{
- handle_object_sit_or_stand();
- // put focus in world when sitting on an object
- gFocusMgr.setKeyboardFocus(NULL);
- return TRUE;
- } // else nothing (fall through to touch)
-
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
+ if (avatarp && !avatarp->isSitting()) // agent not already sitting
+ {
+ handle_object_sit_or_stand();
+ // put focus in world when sitting on an object
+ gFocusMgr.setKeyboardFocus(NULL);
+ return TRUE;
+ } // else nothing (fall through to touch)
+ }
case CLICK_ACTION_PAY:
if ((object && object->flagTakesMoney())
|| (parent && parent->flagTakesMoney()))
@@ -411,9 +412,12 @@ ECursorType cursor_from_object(LLViewerObject* object)
switch(click_action)
{
case CLICK_ACTION_SIT:
- if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->isSitting())) // not already sitting?
{
- cursor = UI_CURSOR_TOOLSIT;
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
+ if (avatarp && !avatarp->isSitting()) // not already sitting?
+ {
+ cursor = UI_CURSOR_TOOLSIT;
+ }
}
break;
case CLICK_ACTION_BUY: