refactor: Change control structures in SOP.StoreUndoState() to reduce nesting.

0.7.4-extended
Justin Clark-Casey (justincc) 2012-09-26 23:25:50 +01:00
parent a4a0396850
commit 371df42d3f
1 changed files with 50 additions and 52 deletions

View File

@ -3150,12 +3150,22 @@ namespace OpenSim.Region.Framework.Scenes
public void StoreUndoState(bool forGroup)
{
if (!Undoing)
if (Undoing)
{
if (!IgnoreUndoUpdate)
{
if (ParentGroup != null)
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId);
return;
}
if (IgnoreUndoUpdate)
{
// m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId);
return;
}
if (ParentGroup == null)
return;
lock (m_undo)
{
if (m_undo.Count > 0)
@ -3197,18 +3207,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
}
// else
// {
// m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId);
// }
}
// else
// {
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId);
// }
}
/// <summary>
/// Return number of undos on the stack. Here temporarily pending a refactor.