| 67 |
|
|
| 68 |
private EntityBase GetEntityBase(uint vId) |
private EntityBase GetEntityBase(uint vId) |
| 69 |
{ |
{ |
| 70 |
SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(vId); |
EntityBase entity; |
| 71 |
if (part != null && (EntityBase)(part.ParentGroup) != null) |
if (myScriptEngine.World.Entities.TryGetValue(vId, out entity)) |
| 72 |
return (EntityBase)(part.ParentGroup); |
{ |
| 73 |
else |
if(entity is SceneObjectGroup) |
| 74 |
|
return entity; |
| 75 |
|
} |
| 76 |
return null; |
return null; |
| 77 |
} |
} |
| 78 |
|
|
| 82 |
{ |
{ |
| 83 |
uint id = System.Convert.ToUInt32(vId, 10); |
uint id = System.Convert.ToUInt32(vId, 10); |
| 84 |
|
|
| 85 |
SceneObjectPart tempobj = myScriptEngine.World.GetSceneObjectPart(id); |
EntityBase entity; |
| 86 |
if (tempobj != null) |
if (myScriptEngine.World.Entities.TryGetValue(id, out entity)) |
| 87 |
|
{ |
| 88 |
|
if (entity is SceneObjectGroup) |
| 89 |
{ |
{ |
| 90 |
m_host = tempobj; |
SceneObjectGroup sog = (SceneObjectGroup)entity; |
| 91 |
m_localID = tempobj.LocalId; |
m_host = sog.RootPart; |
| 92 |
m_itemID = tempobj.UUID; |
m_localID = sog.LocalId; |
| 93 |
|
m_itemID = sog.UUID; |
| 94 |
return true; |
return true; |
| 95 |
} |
} |
| 96 |
|
m_log.DebugFormat("entity not scene object group: {0}", entity.GetType().ToString()); |
| 97 |
|
} |
| 98 |
else |
else |
| 99 |
|
{ |
| 100 |
|
m_log.Debug("no entity found with id"); |
| 101 |
|
} |
| 102 |
return false; |
return false; |
| 103 |
} |
} |
| 104 |
|
|
| 214 |
|
|
| 215 |
if(tempid != UUID.Zero) |
if(tempid != UUID.Zero) |
| 216 |
{ |
{ |
| 217 |
SceneObjectPart tempobj = myScriptEngine.World.GetSceneObjectPart(tempid); |
EntityBase entity; |
| 218 |
if(tempobj != null) |
if (myScriptEngine.World.Entities.TryGetValue(tempid, out entity)) |
| 219 |
return (int)tempobj.LocalId; |
{ |
| 220 |
|
return (int)entity.LocalId; |
| 221 |
|
} |
| 222 |
else |
else |
| 223 |
myScriptEngine.Log.WarnFormat("[PythonScript]: GetPrimLocalIdFromUUID did not find prim with uuid:" + vUUID); |
myScriptEngine.Log.WarnFormat("[PythonScript]: GetPrimLocalIdFromUUID did not find prim with uuid:" + vUUID); |
| 224 |
} |
} |