a few changes on LlGetObjectDetails

0.9.1.0-post-fixes
UbitUmarov 2019-10-20 10:55:13 +01:00
parent ab335b5926
commit 656ea163cc
1 changed files with 17 additions and 9 deletions

View File

@ -14511,19 +14511,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ret.Add(new LSL_Integer(count)); ret.Add(new LSL_Integer(count));
break; break;
case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT:
List<SceneObjectGroup> invAttachments = av.GetAttachments(); if (Attachments == null)
int invcount = 0; Attachments = av.GetAttachments();
count = 0;
try try
{ {
foreach (SceneObjectGroup Attachment in invAttachments) foreach (SceneObjectGroup Attachment in Attachments)
{ {
SceneObjectPart[] parts = Attachment.Parts; SceneObjectPart[] parts = Attachment.Parts;
int nparts = parts.Count(); int nparts = parts.Count();
for(int i = 0; i < nparts; i++) for(int i = 0; i < nparts; i++)
invcount += parts[i].Inventory.Count; count += parts[i].Inventory.Count;
} }
} catch { }; } catch { };
ret.Add(new LSL_Integer(invcount)); ret.Add(new LSL_Integer(count));
break; break;
case ScriptBaseClass.OBJECT_REZZER_KEY: case ScriptBaseClass.OBJECT_REZZER_KEY:
ret.Add(new LSL_Key((string)id)); ret.Add(new LSL_Key((string)id));
@ -14534,14 +14535,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case ScriptBaseClass.OBJECT_TEMP_ATTACHED: case ScriptBaseClass.OBJECT_TEMP_ATTACHED:
ret.Add(new LSL_Integer(0)); ret.Add(new LSL_Integer(0));
break; break;
case ScriptBaseClass.OBJECT_ATTACHED_SLOTS_AVAILABLE:
if (Attachments == null)
Attachments = av.GetAttachments();
ret.Add(new LSL_Integer(38 - Attachments.Count));
break;
case ScriptBaseClass.OBJECT_CREATION_TIME: case ScriptBaseClass.OBJECT_CREATION_TIME:
ret.Add(new LSL_String("")); ret.Add(new LSL_String(""));
break; break;
case ScriptBaseClass.OBJECT_SELECT_COUNT: case ScriptBaseClass.OBJECT_SELECT_COUNT:
ret.Add(new LSL_String("")); ret.Add(new LSL_Integer(0));
break; break;
case ScriptBaseClass.OBJECT_SIT_COUNT: case ScriptBaseClass.OBJECT_SIT_COUNT:
ret.Add(new LSL_String("")); ret.Add(new LSL_Integer(0));
break; break;
case ScriptBaseClass.OBJECT_ANIMATED_COUNT: case ScriptBaseClass.OBJECT_ANIMATED_COUNT:
count = 0; count = 0;
@ -14773,9 +14779,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
break; break;
case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT:
SceneObjectPart[] parts = obj.ParentGroup.Parts; SceneObjectPart[] parts = obj.ParentGroup.Parts;
int nparts = parts.Count();
count = 0; count = 0;
for(int i = 0; i < nparts; i++) for(int i = 0; i < parts.Count(); i++)
count += parts[i].Inventory.Count; count += parts[i].Inventory.Count;
ret.Add(new LSL_Integer(count)); ret.Add(new LSL_Integer(count));
break; break;
@ -14795,6 +14800,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ret.Add(new LSL_Integer(0)); ret.Add(new LSL_Integer(0));
} }
break; break;
case ScriptBaseClass.OBJECT_ATTACHED_SLOTS_AVAILABLE:
ret.Add(new LSL_Integer(0));
break;
case ScriptBaseClass.OBJECT_CREATION_TIME: case ScriptBaseClass.OBJECT_CREATION_TIME:
DateTime date = Util.ToDateTime(m_host.ParentGroup.RootPart.CreationDate); DateTime date = Util.ToDateTime(m_host.ParentGroup.RootPart.CreationDate);
ret.Add(new LSL_String(date.ToString("yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture))); ret.Add(new LSL_String(date.ToString("yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture)));