* Bugfix mantis 4441, "Use of Autopilot isn't playing any animations."

* Turns out the new animator used a different movement bitflag then the one used in the code to autopilot the avatar
mysql-performance
Teravus Ovares (Dan Olivares) 2009-12-12 02:41:59 -05:00
parent 35961caec6
commit 0639e90f56
2 changed files with 15 additions and 5 deletions

View File

@ -128,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
if (!m_scenePresence.IsChildAgent) if (!m_scenePresence.IsChildAgent)
{ {
if (m_animations.TrySetDefaultAnimation( if (m_animations.TrySetDefaultAnimation(
anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero)) anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID))
{ {
// 16384 is CHANGED_ANIMATION // 16384 is CHANGED_ANIMATION
m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { 16384 }); m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { 16384 });

View File

@ -1262,11 +1262,13 @@ namespace OpenSim.Region.Framework.Scenes
{ {
return; return;
} }
bool update_movementflag = false;
if (m_allowMovement) if (m_allowMovement)
{ {
int i = 0; int i = 0;
bool update_movementflag = false;
bool update_rotation = false; bool update_rotation = false;
bool DCFlagKeyPressed = false; bool DCFlagKeyPressed = false;
Vector3 agent_control_v3 = Vector3.Zero; Vector3 agent_control_v3 = Vector3.Zero;
@ -1400,27 +1402,33 @@ namespace OpenSim.Region.Framework.Scenes
if (LocalVectorToTarget2D.Y > 0)//MoveLeft if (LocalVectorToTarget2D.Y > 0)//MoveLeft
{ {
m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT; m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT;
//AgentControlFlags
AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT;
update_movementflag = true; update_movementflag = true;
} }
else if (LocalVectorToTarget2D.Y < 0) //MoveRight else if (LocalVectorToTarget2D.Y < 0) //MoveRight
{ {
m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT; m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT;
AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT;
update_movementflag = true; update_movementflag = true;
} }
if (LocalVectorToTarget2D.X < 0) //MoveBack if (LocalVectorToTarget2D.X < 0) //MoveBack
{ {
m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_BACK; m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_BACK;
AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_BACK;
update_movementflag = true; update_movementflag = true;
} }
else if (LocalVectorToTarget2D.X > 0) //Move Forward else if (LocalVectorToTarget2D.X > 0) //Move Forward
{ {
m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD; m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD;
AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD;
update_movementflag = true; update_movementflag = true;
} }
} }
catch (Exception) catch (Exception e)
{ {
//Avoid system crash, can be slower but... //Avoid system crash, can be slower but...
m_log.DebugFormat("Crash! {0}", e.ToString());
} }
} }
} }
@ -1458,11 +1466,13 @@ namespace OpenSim.Region.Framework.Scenes
AddNewMovement(agent_control_v3, q); AddNewMovement(agent_control_v3, q);
if (update_movementflag)
Animator.UpdateMovementAnimations();
} }
} }
if (update_movementflag)
Animator.UpdateMovementAnimations();
m_scene.EventManager.TriggerOnClientMovement(this); m_scene.EventManager.TriggerOnClientMovement(this);
m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));