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
parent
ccc69d66a1
commit
5c192b9bab
|
@ -1385,17 +1385,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
bool DCFlagKeyPressed = false;
|
bool DCFlagKeyPressed = false;
|
||||||
Vector3 agent_control_v3 = Vector3.Zero;
|
Vector3 agent_control_v3 = Vector3.Zero;
|
||||||
|
|
||||||
bool oldflying = Flying;
|
bool newFlying = actor.Flying;
|
||||||
|
|
||||||
if (ForceFly)
|
if (ForceFly)
|
||||||
actor.Flying = true;
|
newFlying = true;
|
||||||
else if (FlyDisabled)
|
else if (FlyDisabled)
|
||||||
actor.Flying = false;
|
newFlying = false;
|
||||||
else
|
else
|
||||||
actor.Flying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
|
newFlying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
|
||||||
|
|
||||||
if (actor.Flying != oldflying)
|
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;
|
update_movementflag = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (ParentID == 0)
|
if (ParentID == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue