aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorDan Lake2012-12-13 13:05:28 -0800
committerDan Lake2012-12-13 13:05:28 -0800
commit88b094cbf76e9775163ebfdfa23ddb052b62b460 (patch)
tree4507a32549b14b82427f8e736a791242b084ddd1 /OpenSim/Region/Framework
parentFix formatting (diff)
downloadopensim-SC_OLD-88b094cbf76e9775163ebfdfa23ddb052b62b460.zip
opensim-SC_OLD-88b094cbf76e9775163ebfdfa23ddb052b62b460.tar.gz
opensim-SC_OLD-88b094cbf76e9775163ebfdfa23ddb052b62b460.tar.bz2
opensim-SC_OLD-88b094cbf76e9775163ebfdfa23ddb052b62b460.tar.xz
Simplify sit code a bit by determining correct animation in HandleSit instead of HandleSitRequest. This eliminates m_nextSitAnimation, an unneeded state-saving variable in ScenePresence
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs36
1 files changed, 6 insertions, 30 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 6f36c0b..58721b0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -212,8 +212,6 @@ namespace OpenSim.Region.Framework.Scenes
212 212
213 private Quaternion m_headrotation = Quaternion.Identity; 213 private Quaternion m_headrotation = Quaternion.Identity;
214 214
215 private string m_nextSitAnimation = String.Empty;
216
217 //PauPaw:Proper PID Controler for autopilot************ 215 //PauPaw:Proper PID Controler for autopilot************
218 public bool MovingToTarget { get; private set; } 216 public bool MovingToTarget { get; private set; }
219 public Vector3 MoveToPositionTarget { get; private set; } 217 public Vector3 MoveToPositionTarget { get; private set; }
@@ -1955,25 +1953,10 @@ namespace OpenSim.Region.Framework.Scenes
1955 StandUp(); 1953 StandUp();
1956 } 1954 }
1957 1955
1958// if (!String.IsNullOrEmpty(sitAnimation))
1959// {
1960// m_nextSitAnimation = sitAnimation;
1961// }
1962// else
1963// {
1964 m_nextSitAnimation = "SIT";
1965// }
1966
1967 //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID);
1968 SceneObjectPart part = FindNextAvailableSitTarget(targetID); 1956 SceneObjectPart part = FindNextAvailableSitTarget(targetID);
1969 1957
1970 if (part != null) 1958 if (part != null)
1971 { 1959 {
1972 if (!String.IsNullOrEmpty(part.SitAnimation))
1973 {
1974 m_nextSitAnimation = part.SitAnimation;
1975 }
1976
1977 m_requestedSitTargetID = part.LocalId; 1960 m_requestedSitTargetID = part.LocalId;
1978 m_requestedSitTargetUUID = targetID; 1961 m_requestedSitTargetUUID = targetID;
1979 1962
@@ -2188,18 +2171,6 @@ namespace OpenSim.Region.Framework.Scenes
2188 2171
2189 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) 2172 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID)
2190 { 2173 {
2191 if (!String.IsNullOrEmpty(m_nextSitAnimation))
2192 {
2193 HandleAgentSit(remoteClient, agentID, m_nextSitAnimation);
2194 }
2195 else
2196 {
2197 HandleAgentSit(remoteClient, agentID, "SIT");
2198 }
2199 }
2200
2201 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID, string sitAnimation)
2202 {
2203 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); 2174 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
2204 2175
2205 if (part != null) 2176 if (part != null)
@@ -2246,7 +2217,12 @@ namespace OpenSim.Region.Framework.Scenes
2246 2217
2247 Velocity = Vector3.Zero; 2218 Velocity = Vector3.Zero;
2248 RemoveFromPhysicalScene(); 2219 RemoveFromPhysicalScene();
2249 2220
2221 String sitAnimation = "SIT";
2222 if (!String.IsNullOrEmpty(part.SitAnimation))
2223 {
2224 sitAnimation = part.SitAnimation;
2225 }
2250 Animator.TrySetMovementAnimation(sitAnimation); 2226 Animator.TrySetMovementAnimation(sitAnimation);
2251 SendAvatarDataToAllAgents(); 2227 SendAvatarDataToAllAgents();
2252 } 2228 }