mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user