Modify order of code so SOP doesn't set the physics actor flying

property multiple times every time Update is called.
This eliminates zillions of settings which is better for BulletSim.
The should be no functionality change.
integration
Robert Adams 2012-08-17 13:26:18 -07:00
parent ccc69d66a1
commit 5c192b9bab
1 changed files with 12 additions and 7 deletions

View File

@ -1385,17 +1385,22 @@ namespace OpenSim.Region.Framework.Scenes
bool DCFlagKeyPressed = false;
Vector3 agent_control_v3 = Vector3.Zero;
bool oldflying = Flying;
bool newFlying = actor.Flying;
if (ForceFly)
actor.Flying = true;
newFlying = true;
else if (FlyDisabled)
actor.Flying = false;
newFlying = false;
else
actor.Flying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
if (actor.Flying != oldflying)
update_movementflag = true;
newFlying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
if (actor.Flying != newFlying)
{
// Note: ScenePresence.Flying is actually fetched from the physical actor
// so setting PhysActor.Flying here also sets the ScenePresence's value.
actor.Flying = newFlying;
update_movementflag = true;
}
if (ParentID == 0)
{