add some sanity checking to HandleAgentRequestSit handler

0.7.5-pf-bulletsim
dahlia 2013-01-10 20:21:18 -08:00 committed by Justin Clark-Casey (justincc)
parent c182157d4d
commit af27180131
1 changed files with 12 additions and 2 deletions

View File

@ -6428,8 +6428,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit;
if (handlerAgentRequestSit != null)
handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID,
agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset);
if (!(agentRequestSit.AgentData == null
|| agentRequestSit.TargetObject == null
|| agentRequestSit.TargetObject.TargetID == null
|| agentRequestSit.TargetObject.Offset == null))
{
var sp = m_scene.GetScenePresence(agentRequestSit.AgentData.AgentID);
if (sp == null || sp.ParentID != 0) // ignore packet if agent is already sitting
return true;
handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID,
agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset);
}
}
return true;
}