diff options
author | UbitUmarov | 2015-09-30 05:57:02 +0100 |
---|---|---|
committer | UbitUmarov | 2015-09-30 05:57:02 +0100 |
commit | 5b7a3c703d0ff75e25af244ce8789e1431bff81e (patch) | |
tree | 469344a7c548c9466d8941f44a59221d61adf777 /OpenSim/Region/Framework/Scenes | |
parent | add several options for NPC creation so abusive use can be reduced (restrict... (diff) | |
download | opensim-SC-5b7a3c703d0ff75e25af244ce8789e1431bff81e.zip opensim-SC-5b7a3c703d0ff75e25af244ce8789e1431bff81e.tar.gz opensim-SC-5b7a3c703d0ff75e25af244ce8789e1431bff81e.tar.bz2 opensim-SC-5b7a3c703d0ff75e25af244ce8789e1431bff81e.tar.xz |
clamp all draw distance changes within region limits
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4e2ea28..175f718 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -561,9 +561,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
561 | /// </summary> | 561 | /// </summary> |
562 | public bool UseFakeGroupTitle { get; set; } | 562 | public bool UseFakeGroupTitle { get; set; } |
563 | 563 | ||
564 | |||
565 | // Agent's Draw distance. | 564 | // Agent's Draw distance. |
566 | public float DrawDistance { get; set; } | 565 | private float m_drawDistance = 255f; |
566 | public float DrawDistance | ||
567 | { | ||
568 | get | ||
569 | { | ||
570 | return m_drawDistance; | ||
571 | } | ||
572 | set | ||
573 | { | ||
574 | m_drawDistance = Util.Clamp(value, 32f, m_scene.MaxDrawDistance); | ||
575 | } | ||
576 | } | ||
567 | 577 | ||
568 | public bool AllowMovement { get; set; } | 578 | public bool AllowMovement { get; set; } |
569 | 579 | ||
@@ -2174,7 +2184,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2174 | // changes, then start using the agent's drawdistance rather than the | 2184 | // changes, then start using the agent's drawdistance rather than the |
2175 | // region's draw distance. | 2185 | // region's draw distance. |
2176 | 2186 | ||
2177 | DrawDistance = Util.Clamp(agentData.Far, 32, m_scene.MaxDrawDistance); | 2187 | DrawDistance = agentData.Far; |
2178 | 2188 | ||
2179 | m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0; | 2189 | m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0; |
2180 | 2190 | ||
@@ -2534,7 +2544,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2534 | // changes, then start using the agent's drawdistance rather than the | 2544 | // changes, then start using the agent's drawdistance rather than the |
2535 | // region's draw distance. | 2545 | // region's draw distance. |
2536 | 2546 | ||
2537 | DrawDistance = Util.Clamp(agentData.Far, 32, m_scene.MaxDrawDistance); | 2547 | DrawDistance = agentData.Far; |
2538 | 2548 | ||
2539 | // Check if Client has camera in 'follow cam' or 'build' mode. | 2549 | // Check if Client has camera in 'follow cam' or 'build' mode. |
2540 | Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); | 2550 | Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); |
@@ -4187,11 +4197,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4187 | 4197 | ||
4188 | Vector3 offset = new Vector3(shiftx, shifty, 0f); | 4198 | Vector3 offset = new Vector3(shiftx, shifty, 0f); |
4189 | 4199 | ||
4190 | // When we get to the point of re-computing neighbors everytime this | ||
4191 | // changes, then start using the agent's drawdistance rather than the | ||
4192 | // region's draw distance. | ||
4193 | DrawDistance = cAgentData.Far; | 4200 | DrawDistance = cAgentData.Far; |
4194 | // DrawDistance = Scene.DefaultDrawDistance; | ||
4195 | 4201 | ||
4196 | if (cAgentData.Position != marker) // UGH!! | 4202 | if (cAgentData.Position != marker) // UGH!! |
4197 | m_pos = cAgentData.Position + offset; | 4203 | m_pos = cAgentData.Position + offset; |