a few more changes to lsl list; add osListSortInPlace(LSL_List src, LSL_Integer stride, LSL_Integer ascending), does the sort directly on src, avoiding creation on a new list when that is not needed

This commit is contained in:
UbitUmarov
2021-05-31 18:12:33 +01:00
parent afaa181676
commit 4855e11346
3 changed files with 42 additions and 17 deletions

View File

@@ -764,15 +764,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
//
CheckThreatLevel(ThreatLevel.VeryHigh, "osSetRot");
if (World.Entities.ContainsKey(target))
if (World.Entities.TryGetValue(target, out EntityBase entity))
{
if (World.Entities.TryGetValue(target, out EntityBase entity))
{
if (entity is SceneObjectGroup)
((SceneObjectGroup)entity).UpdateGroupRotationR(rotation);
else if (entity is ScenePresence)
((ScenePresence)entity).Rotation = rotation;
}
if (entity is SceneObjectGroup)
((SceneObjectGroup)entity).UpdateGroupRotationR(rotation);
else if (entity is ScenePresence)
((ScenePresence)entity).Rotation = rotation;
}
else
{
@@ -6096,5 +6093,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return av.IsNPC ? 2 : 1;
}
public void osListSortInPlace(LSL_List src, LSL_Integer stride, LSL_Integer ascending)
{
src.SortInPlace(stride, ascending == 1);
}
}
}