mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
cosmetics
This commit is contained in:
@@ -2351,38 +2351,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
protected static LSL_String GetTexture(SceneObjectPart part, int face)
|
||||
{
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
face = 0;
|
||||
if (face < 0)
|
||||
return ScriptBaseClass.NULL_KEY;
|
||||
|
||||
Primitive.TextureEntry tex = part.Shape.Textures;
|
||||
int nsides = GetNumberOfSides(part);
|
||||
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
{
|
||||
face = 0;
|
||||
}
|
||||
|
||||
if (face >= 0 && face < nsides)
|
||||
{
|
||||
Primitive.TextureEntryFace texface;
|
||||
texface = tex.GetFace((uint)face);
|
||||
string texture = texface.TextureID.ToString();
|
||||
|
||||
lock (part.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in part.TaskInventory)
|
||||
{
|
||||
if (inv.Value.AssetID.Equals(texface.TextureID))
|
||||
{
|
||||
texture = inv.Value.Name.ToString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return texture;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (face >= nsides)
|
||||
return ScriptBaseClass.NULL_KEY;
|
||||
|
||||
Primitive.TextureEntryFace texface;
|
||||
texface = tex.GetFace((uint)face);
|
||||
|
||||
lock (part.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in part.TaskInventory)
|
||||
{
|
||||
if (inv.Value.AssetID.Equals(texface.TextureID))
|
||||
return inv.Value.Name.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
return texface.TextureID.ToString();
|
||||
}
|
||||
|
||||
public void llSetPos(LSL_Vector pos)
|
||||
|
||||
@@ -4106,33 +4106,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets terrain estate texture
|
||||
/// Sets terrain texture
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
/// <param name="texture"></param>
|
||||
/// <returns></returns>
|
||||
public void osSetTerrainTexture(int level, LSL_Key texture)
|
||||
{
|
||||
if (level < 0 || level > 3)
|
||||
return;
|
||||
if (!UUID.TryParse(texture, out UUID textureID))
|
||||
return;
|
||||
|
||||
CheckThreatLevel(ThreatLevel.High, "osSetTerrainTexture");
|
||||
|
||||
//Check to make sure that the script's owner is the estate manager/master
|
||||
//World.Permissions.GenericEstatePermission(
|
||||
if (World.Permissions.IsGod(m_host.OwnerID))
|
||||
{
|
||||
if (level < 0 || level > 3)
|
||||
return;
|
||||
|
||||
if (!UUID.TryParse(texture, out UUID textureID))
|
||||
return;
|
||||
|
||||
// estate module is required
|
||||
IEstateModule estate = World.RequestModuleInterface<IEstateModule>();
|
||||
estate?.setEstateTerrainBaseTexture(level, textureID);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets terrain heights of estate
|
||||
/// Sets terrain textures heights
|
||||
/// </summary>
|
||||
/// <param name="corner"></param>
|
||||
/// <param name="low"></param>
|
||||
@@ -4140,16 +4136,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
/// <returns></returns>
|
||||
public void osSetTerrainTextureHeight(int corner, double low, double high)
|
||||
{
|
||||
if (corner < 0 || corner > 3)
|
||||
return;
|
||||
|
||||
CheckThreatLevel(ThreatLevel.High, "osSetTerrainTextureHeight");
|
||||
|
||||
//Check to make sure that the script's owner is the estate manager/master
|
||||
//World.Permissions.GenericEstatePermission(
|
||||
if (World.Permissions.IsGod(m_host.OwnerID))
|
||||
{
|
||||
if (corner < 0 || corner > 3)
|
||||
return;
|
||||
|
||||
// estate module is required
|
||||
IEstateModule estate = World.RequestModuleInterface<IEstateModule>();
|
||||
estate?.setEstateTerrainTextureHeights(corner, (float)low, (float)high);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user