diff options
Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 49 |
1 files changed, 38 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index db9a95b..a1ca9c5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3102,29 +3102,57 @@ namespace OpenSim.Region.Framework.Scenes | |||
3102 | // Makes sure avatar does not end up outside region | 3102 | // Makes sure avatar does not end up outside region |
3103 | if (neighbor <= 0) | 3103 | if (neighbor <= 0) |
3104 | { | 3104 | { |
3105 | if (!needsTransit) | 3105 | if (needsTransit) |
3106 | { | 3106 | { |
3107 | if (m_requestedSitTargetUUID == UUID.Zero) | 3107 | if (m_requestedSitTargetUUID == UUID.Zero) |
3108 | { | 3108 | { |
3109 | bool isFlying = m_physicsActor.Flying; | ||
3110 | RemoveFromPhysicalScene(); | ||
3111 | |||
3109 | Vector3 pos = AbsolutePosition; | 3112 | Vector3 pos = AbsolutePosition; |
3110 | if (AbsolutePosition.X < 0) | 3113 | if (AbsolutePosition.X < 0) |
3111 | pos.X += Velocity.X; | 3114 | pos.X += Velocity.X * 2; |
3112 | else if (AbsolutePosition.X > Constants.RegionSize) | 3115 | else if (AbsolutePosition.X > Constants.RegionSize) |
3113 | pos.X -= Velocity.X; | 3116 | pos.X -= Velocity.X * 2; |
3114 | if (AbsolutePosition.Y < 0) | 3117 | if (AbsolutePosition.Y < 0) |
3115 | pos.Y += Velocity.Y; | 3118 | pos.Y += Velocity.Y * 2; |
3116 | else if (AbsolutePosition.Y > Constants.RegionSize) | 3119 | else if (AbsolutePosition.Y > Constants.RegionSize) |
3117 | pos.Y -= Velocity.Y; | 3120 | pos.Y -= Velocity.Y * 2; |
3121 | Velocity = Vector3.Zero; | ||
3118 | AbsolutePosition = pos; | 3122 | AbsolutePosition = pos; |
3123 | |||
3124 | AddToPhysicalScene(isFlying); | ||
3119 | } | 3125 | } |
3120 | } | 3126 | } |
3121 | } | 3127 | } |
3122 | else if (neighbor > 0) | 3128 | else if (neighbor > 0) |
3123 | CrossToNewRegion(); | 3129 | { |
3130 | if (!CrossToNewRegion()) | ||
3131 | { | ||
3132 | if (m_requestedSitTargetUUID == UUID.Zero) | ||
3133 | { | ||
3134 | bool isFlying = m_physicsActor.Flying; | ||
3135 | RemoveFromPhysicalScene(); | ||
3136 | |||
3137 | Vector3 pos = AbsolutePosition; | ||
3138 | if (AbsolutePosition.X < 0) | ||
3139 | pos.X += Velocity.X * 2; | ||
3140 | else if (AbsolutePosition.X > Constants.RegionSize) | ||
3141 | pos.X -= Velocity.X * 2; | ||
3142 | if (AbsolutePosition.Y < 0) | ||
3143 | pos.Y += Velocity.Y * 2; | ||
3144 | else if (AbsolutePosition.Y > Constants.RegionSize) | ||
3145 | pos.Y -= Velocity.Y * 2; | ||
3146 | Velocity = Vector3.Zero; | ||
3147 | AbsolutePosition = pos; | ||
3148 | |||
3149 | AddToPhysicalScene(isFlying); | ||
3150 | } | ||
3151 | } | ||
3152 | } | ||
3124 | } | 3153 | } |
3125 | else | 3154 | else |
3126 | { | 3155 | { |
3127 | RemoveFromPhysicalScene(); | ||
3128 | // This constant has been inferred from experimentation | 3156 | // This constant has been inferred from experimentation |
3129 | // I'm not sure what this value should be, so I tried a few values. | 3157 | // I'm not sure what this value should be, so I tried a few values. |
3130 | timeStep = 0.04f; | 3158 | timeStep = 0.04f; |
@@ -3173,16 +3201,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
3173 | /// If the neighbor accepts, remove the agent's viewable avatar from this scene | 3201 | /// If the neighbor accepts, remove the agent's viewable avatar from this scene |
3174 | /// set them to a child agent. | 3202 | /// set them to a child agent. |
3175 | /// </summary> | 3203 | /// </summary> |
3176 | protected void CrossToNewRegion() | 3204 | protected bool CrossToNewRegion() |
3177 | { | 3205 | { |
3178 | InTransit(); | ||
3179 | try | 3206 | try |
3180 | { | 3207 | { |
3181 | m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); | 3208 | return m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); |
3182 | } | 3209 | } |
3183 | catch | 3210 | catch |
3184 | { | 3211 | { |
3185 | m_scene.CrossAgentToNewRegion(this, false); | 3212 | return m_scene.CrossAgentToNewRegion(this, false); |
3186 | } | 3213 | } |
3187 | } | 3214 | } |
3188 | 3215 | ||