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
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)
{
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;
}
if (regionCount > 0 | allowRegionless)
if (regionCount > 0 || allowRegionless)
return regionInfos;
m_log.Debug("[WEBLOADER]: Request yielded no regions.");

View File

@ -899,7 +899,7 @@ namespace OpenSim.Framework
/// <returns></returns>
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;
}

View File

@ -396,7 +396,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
{
folder = invService.GetFolder(client.AgentId, inventoryID);
if (folder != null & trashFolder != null)
if (folder != null && trashFolder != null)
{
previousParentFolderID = folder.ParentID;
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;

View File

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