c# sugar...

This commit is contained in:
UbitUmarov
2022-10-08 02:25:07 +01:00
parent 8ca82b2282
commit 5c3d86937f
2 changed files with 11 additions and 28 deletions

View File

@@ -164,10 +164,10 @@ namespace OpenSim.Groups
void OnCompleteMovementToRegion(IClientAPI client, bool arg2)
{
object sp = null;
if (client.Scene.TryGetScenePresence(client.AgentId, out sp))
ScenePresence sp = client.SceneAgent as ScenePresence;
if (sp is not null)
{
if (sp is ScenePresence && ((ScenePresence)sp).PresenceType != PresenceType.Npc)
if (sp.PresenceType != PresenceType.Npc)
{
AgentCircuitData aCircuit = ((ScenePresence)sp).Scene.AuthenticateHandler.GetAgentCircuitData(client.AgentId);
if (aCircuit != null && (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 &&

View File

@@ -659,11 +659,8 @@ namespace OpenSim.Region.Framework.Scenes
if (Vector3.DistanceSquared(RootPart.StatusSandboxPos, value) > 100)
{
RootPart.ScriptSetPhysicsStatus(false);
if (Scene is not null)
Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
Scene?.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
return;
}
}
@@ -700,9 +697,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
if (Scene is not null)
Scene.EventManager.TriggerParcelPrimCountTainted();
Scene?.EventManager.TriggerParcelPrimCountTainted();
}
}
@@ -1030,11 +1025,8 @@ namespace OpenSim.Region.Framework.Scenes
av.sitSOGmoved();
}
if (sog.m_rootPart.KeyframeMotion is not null)
sog.m_rootPart.KeyframeMotion.CrossingFailure();
if (sog.RootPart.PhysActor is not null)
sog.RootPart.PhysActor.CrossingFailure();
sog.m_rootPart.KeyframeMotion?.CrossingFailure();
sog.RootPart.PhysActor?.CrossingFailure();
sog.inTransit = false;
AttachToBackup();
@@ -1333,11 +1325,7 @@ namespace OpenSim.Region.Framework.Scenes
{
get
{
if (m_scene is not null)
{
return m_scene.RegionInfo.RegionID;
}
return UUID.Zero;
return m_scene is not null ? m_scene.RegionInfo.RegionID : UUID.Zero;
}
}
@@ -2173,11 +2161,7 @@ namespace OpenSim.Region.Framework.Scenes
public UUID GetPartsFullID(uint localID)
{
SceneObjectPart part = GetPart(localID);
if (part is not null)
{
return part.UUID;
}
return UUID.Zero;
return part is not null ? part.UUID : UUID.Zero;
}
public void ObjectGrabHandler(uint localId, Vector3 offsetPos, IClientAPI remoteClient)
@@ -2974,8 +2958,7 @@ namespace OpenSim.Region.Framework.Scenes
if (IsAttachment)
{
ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar);
if (sp is not null)
sp.SendAttachmentScheduleUpdate(this);
sp?.SendAttachmentScheduleUpdate(this);
return;
}
@@ -5407,7 +5390,7 @@ namespace OpenSim.Region.Framework.Scenes
public virtual string ExtraToXmlString()
{
return $"<ExtraFromItemID>{FromItemID.ToString()}</ExtraFromItemID>";
return $"<ExtraFromItemID>{FromItemID}</ExtraFromItemID>";
}
public virtual void ExtraFromXmlString(string xmlstr)