mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
Prevent a null ref when getting the velocity of an avatar during login or
logout.
This commit is contained in:
@@ -2536,12 +2536,13 @@ 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);
|
||||
vel = avatar.Velocity;
|
||||
if (avatar != null)
|
||||
vel = avatar.Velocity;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user