refactor: Change control structures in SOP.StoreUndoState() to reduce nesting.
parent
febc6bae30
commit
86f519ba57
|
@ -3150,12 +3150,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public void StoreUndoState(bool forGroup)
|
public void StoreUndoState(bool forGroup)
|
||||||
{
|
{
|
||||||
if (!Undoing)
|
if (Undoing)
|
||||||
{
|
{
|
||||||
if (!IgnoreUndoUpdate)
|
// m_log.DebugFormat(
|
||||||
{
|
// "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId);
|
||||||
if (ParentGroup != null)
|
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)
|
lock (m_undo)
|
||||||
{
|
{
|
||||||
if (m_undo.Count > 0)
|
if (m_undo.Count > 0)
|
||||||
|
@ -3166,9 +3176,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// TODO: May need to fix for group comparison
|
// TODO: May need to fix for group comparison
|
||||||
if (last.Compare(this))
|
if (last.Compare(this))
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}",
|
// "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}",
|
||||||
// Name, LocalId, m_undo.Count);
|
// Name, LocalId, m_undo.Count);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -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>
|
/// <summary>
|
||||||
/// Return number of undos on the stack. Here temporarily pending a refactor.
|
/// Return number of undos on the stack. Here temporarily pending a refactor.
|
||||||
|
|
Loading…
Reference in New Issue