code aesthetics

0.9.1.0-post-fixes
UbitUmarov 2018-11-17 17:05:28 +00:00
parent 1f5169e636
commit efd6fb05a9
5 changed files with 42 additions and 20 deletions

View File

@ -492,7 +492,7 @@ namespace OpenSim.Groups
// check permissions // check permissions
bool limited = HasPower(RequestingAgentID, GroupID, GroupPowers.AssignMemberLimited); bool limited = HasPower(RequestingAgentID, GroupID, GroupPowers.AssignMemberLimited);
bool unlimited = HasPower(RequestingAgentID, GroupID, GroupPowers.AssignMember) | IsOwner(RequestingAgentID, GroupID); bool unlimited = HasPower(RequestingAgentID, GroupID, GroupPowers.AssignMember) || IsOwner(RequestingAgentID, GroupID);
if (!limited && !unlimited) if (!limited && !unlimited)
{ {
m_log.DebugFormat("[Groups]: ({0}) Attempt at assigning {1} to role {2} denied because of lack of permission", RequestingAgentID, AgentID, RoleID); m_log.DebugFormat("[Groups]: ({0}) Attempt at assigning {1} to role {2} denied because of lack of permission", RequestingAgentID, AgentID, RoleID);

View File

@ -122,7 +122,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
throw ex; throw ex;
} }
if (regionCount > 0 | allowRegionless) if (regionCount > 0 || allowRegionless)
return regionInfos; return regionInfos;
m_log.Debug("[WEBLOADER]: Request yielded no regions."); m_log.Debug("[WEBLOADER]: Request yielded no regions.");

View File

@ -899,7 +899,7 @@ namespace OpenSim.Framework
/// <returns></returns> /// <returns></returns>
public static bool IsInsideBox(Vector3 v, Vector3 min, Vector3 max) public static bool IsInsideBox(Vector3 v, Vector3 min, Vector3 max)
{ {
return v.X >= min.X & v.Y >= min.Y && v.Z >= min.Z return v.X >= min.X && v.Y >= min.Y && v.Z >= min.Z
&& v.X <= max.X && v.Y <= max.Y && v.Z <= max.Z; && v.X <= max.X && v.Y <= max.Y && v.Z <= max.Z;
} }

View File

@ -396,7 +396,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
{ {
folder = invService.GetFolder(client.AgentId, inventoryID); folder = invService.GetFolder(client.AgentId, inventoryID);
if (folder != null & trashFolder != null) if (folder != null && trashFolder != null)
{ {
previousParentFolderID = folder.ParentID; previousParentFolderID = folder.ParentID;
folder.ParentID = trashFolder.ID; folder.ParentID = trashFolder.ID;
@ -405,7 +405,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
} }
} }
if ((null == item && null == folder) | null == trashFolder) if ((null == item && null == folder) || null == trashFolder)
{ {
string reason = String.Empty; string reason = String.Empty;

View File

@ -84,16 +84,26 @@ namespace OpenSim.Region.ScriptEngine.Shared
{ {
str = str.Replace('<', ' '); str = str.Replace('<', ' ');
str = str.Replace('>', ' '); str = str.Replace('>', ' ');
string[] tmps = str.Split(new Char[] { ',', '<', '>' }); string[] tmps = str.Split(new Char[] {','});
if (tmps.Length < 3) if (tmps.Length < 3)
{ {
x=y=z=0; z = y = x = 0;
return; return;
} }
bool res; if (!Double.TryParse(tmps[0], NumberStyles.Float, Culture.NumberFormatInfo, out x))
res = Double.TryParse(tmps[0], NumberStyles.Float, Culture.NumberFormatInfo, out x); {
res = res & Double.TryParse(tmps[1], NumberStyles.Float, Culture.NumberFormatInfo, out y); z = y = 0;
res = res & Double.TryParse(tmps[2], NumberStyles.Float, Culture.NumberFormatInfo, out z); return;
}
if (!Double.TryParse(tmps[1], NumberStyles.Float, Culture.NumberFormatInfo, out y))
{
z = x = 0;
return;
}
if (!Double.TryParse(tmps[2], NumberStyles.Float, Culture.NumberFormatInfo, out z))
{
y = x = 0;
}
} }
#endregion #endregion
@ -364,19 +374,31 @@ namespace OpenSim.Region.ScriptEngine.Shared
{ {
str = str.Replace('<', ' '); str = str.Replace('<', ' ');
str = str.Replace('>', ' '); str = str.Replace('>', ' ');
string[] tmps = str.Split(new Char[] { ',', '<', '>' }); string[] tmps = str.Split(new Char[] {','});
if (tmps.Length < 4) if (tmps.Length < 4 ||
!Double.TryParse(tmps[3], NumberStyles.Float, Culture.NumberFormatInfo, out s))
{ {
x=y=z=s=0; z = y = x = 0;
s = 1;
return; return;
} }
bool res; if (!Double.TryParse(tmps[0], NumberStyles.Float, Culture.NumberFormatInfo, out x))
res = Double.TryParse(tmps[0], NumberStyles.Float, Culture.NumberFormatInfo, out x); {
res = res & Double.TryParse(tmps[1], NumberStyles.Float, Culture.NumberFormatInfo, out y); z = y = 0;
res = res & Double.TryParse(tmps[2], NumberStyles.Float, Culture.NumberFormatInfo, out z);
res = res & Double.TryParse(tmps[3], NumberStyles.Float, Culture.NumberFormatInfo, out s);
if (s == 0 && x == 0 && y == 0 && z == 0)
s = 1; s = 1;
return;
}
if (!Double.TryParse(tmps[1], NumberStyles.Float, Culture.NumberFormatInfo, out y))
{
z = x = 0;
s = 1;
return;
}
if (!Double.TryParse(tmps[2], NumberStyles.Float, Culture.NumberFormatInfo, out z))
{
y = x = 0;
s = 1;
}
} }
public Quaternion(OMV_Quaternion rot) public Quaternion(OMV_Quaternion rot)