Prevent a null ref when getting the velocity of an avatar during login or
logout.avinationmerge
parent
bdc62144ae
commit
5876a4d392
|
@ -2536,11 +2536,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
Vector3 vel;
|
||||
Vector3 vel = Vector3.Zero;
|
||||
|
||||
if (m_host.ParentGroup.IsAttachment)
|
||||
{
|
||||
ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar);
|
||||
if (avatar != null)
|
||||
vel = avatar.Velocity;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue