add some sanity checking to HandleAgentRequestSit handler

user_profiles
dahlia 2013-01-10 20:21:18 -08:00
parent 660d36a5b0
commit 72cc94cfbc
1 changed files with 12 additions and 2 deletions

View File

@ -6428,9 +6428,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit; AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit;
if (handlerAgentRequestSit != null) if (handlerAgentRequestSit != null)
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, handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID,
agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset);
} }
}
return true; return true;
} }