aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llvoavatar.cpp')
-rw-r--r--linden/indra/newview/llvoavatar.cpp63
1 files changed, 35 insertions, 28 deletions
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index 69e239a..49d786d 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -3942,7 +3942,7 @@ void LLVOAvatar::idleUpdateTractorBeam()
3942 msg->nextBlockFast(_PREHASH_ChatData); 3942 msg->nextBlockFast(_PREHASH_ChatData);
3943 msg->addStringFast(_PREHASH_Message, "stop"); 3943 msg->addStringFast(_PREHASH_Message, "stop");
3944 msg->addU8Fast(_PREHASH_Type, CHAT_TYPE_WHISPER); 3944 msg->addU8Fast(_PREHASH_Type, CHAT_TYPE_WHISPER);
3945 msg->addS32("Channel", 9000); 3945 msg->addS32("Channel", gSavedSettings.getS32("ParticleChatChannel"));
3946 3946
3947 gAgent.sendReliableMessage(); 3947 gAgent.sendReliableMessage();
3948 sBeamLastAt = LLVector3d::zero; 3948 sBeamLastAt = LLVector3d::zero;
@@ -3962,53 +3962,58 @@ void LLVOAvatar::idleUpdateTractorBeam()
3962 if (!mBeam.isNull()) 3962 if (!mBeam.isNull())
3963 { 3963 {
3964 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); 3964 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
3965 LLViewerObject* obj_sel = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
3965 3966
3966 if (gAgent.mPointAt.notNull()) 3967 if (gAgent.mPointAt.notNull())
3967 { 3968 {
3968 // get point from pointat effect 3969 // get point from pointat effect
3969 mBeam->setPositionGlobal(gAgent.mPointAt->getPointAtPosGlobal()); 3970 mBeam->setPositionGlobal(gAgent.mPointAt->getPointAtPosGlobal());
3970 3971
3972 //lgg crap
3971 if(gSavedSettings.getBOOL("ParticleChat")) 3973 if(gSavedSettings.getBOOL("ParticleChat"))
3972 { 3974 {
3973 if(sPartsNow != TRUE) 3975 if(sPartsNow != TRUE)
3974 { 3976 {
3975 sPartsNow = TRUE; 3977
3976 LLMessageSystem* msg = gMessageSystem; 3978 sPartsNow = TRUE;
3977 msg->newMessageFast(_PREHASH_ChatFromViewer); 3979 if(obj_sel){
3978 msg->nextBlockFast(_PREHASH_AgentData); 3980 LLMessageSystem* msg = gMessageSystem;
3979 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 3981 msg->newMessageFast(_PREHASH_ChatFromViewer);
3980 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 3982 msg->nextBlockFast(_PREHASH_AgentData);
3981 msg->nextBlockFast(_PREHASH_ChatData); 3983 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
3982 msg->addStringFast(_PREHASH_Message, "start"); 3984 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
3983 msg->addU8Fast(_PREHASH_Type, CHAT_TYPE_WHISPER); 3985 msg->nextBlockFast(_PREHASH_ChatData);
3984 msg->addS32("Channel", 9000); 3986 msg->addStringFast(_PREHASH_Message, "start"+obj_sel->getID().asString());
3985 3987 msg->addU8Fast(_PREHASH_Type, CHAT_TYPE_WHISPER);
3986 gAgent.sendReliableMessage(); 3988 msg->addS32("Channel", gSavedSettings.getS32("ParticleChatChannel"));
3989
3990 gAgent.sendReliableMessage();
3991 }
3987 3992
3988 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT); 3993 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT);
3989 } 3994 }
3990 //LLVector3d a = sBeamLastAt-gAgent.mPointAt->getPointAtPosGlobal(); 3995
3991 //if(a.length > 2)
3992 if( (sBeamLastAt-gAgent.mPointAt->getPointAtPosGlobal()).length() > .2) 3996 if( (sBeamLastAt-gAgent.mPointAt->getPointAtPosGlobal()).length() > .2)
3993 //if(sBeamLastAt!=gAgent.mPointAt->getPointAtPosGlobal())
3994 { 3997 {
3995 sBeamLastAt = gAgent.mPointAt->getPointAtPosGlobal(); 3998 sBeamLastAt = gAgent.mPointAt->getPointAtPosGlobal();
3996
3997 LLMessageSystem* msg = gMessageSystem;
3998 msg->newMessageFast(_PREHASH_ChatFromViewer);
3999 msg->nextBlockFast(_PREHASH_AgentData);
4000 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
4001 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
4002 msg->nextBlockFast(_PREHASH_ChatData);
4003 msg->addStringFast(_PREHASH_Message, llformat("<%.6f, %.6f, %.6f>",(F32)(sBeamLastAt.mdV[VX]),(F32)(sBeamLastAt.mdV[VY]),(F32)(sBeamLastAt.mdV[VZ])));
4004 msg->addU8Fast(_PREHASH_Type, CHAT_TYPE_WHISPER);
4005 msg->addS32("Channel", 9000); // *TODO: make configurable
4006 3999
4007 gAgent.sendReliableMessage(); 4000 if(obj_sel){
4001 LLMessageSystem* msg = gMessageSystem;
4002 msg->newMessageFast(_PREHASH_ChatFromViewer);
4003 msg->nextBlockFast(_PREHASH_AgentData);
4004 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
4005 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
4006 msg->nextBlockFast(_PREHASH_ChatData);
4007 msg->addStringFast(_PREHASH_Message, "start"+obj_sel->getID().asString());
4008 msg->addU8Fast(_PREHASH_Type, CHAT_TYPE_WHISPER);
4009 msg->addS32("Channel", gSavedSettings.getS32("ParticleChatChannel"));
4010
4011 gAgent.sendReliableMessage();
4012 }
4008 } 4013 }
4009 4014
4010 } 4015 }
4011 4016
4012 mBeam->triggerLocal(); 4017 mBeam->triggerLocal();
4013 } 4018 }
4014 else if (selection->getFirstRootObject() && 4019 else if (selection->getFirstRootObject() &&
@@ -4047,6 +4052,8 @@ void LLVOAvatar::idleUpdateTractorBeam()
4047 } 4052 }
4048 } 4053 }
4049} 4054}
4055//</edit>
4056
4050 4057
4051void LLVOAvatar::idleUpdateBelowWater() 4058void LLVOAvatar::idleUpdateBelowWater()
4052{ 4059{