dependency handling for keywords

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@265 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-04-18 22:59:03 +00:00
parent 99f44292d6
commit 9f24da8d02
5 changed files with 54 additions and 9 deletions
+4 -2
View File
@@ -33,8 +33,10 @@ void ActionStack::add(Action* action, bool allow_merge) {
FOR_EACH(a, redo_actions) delete a;
redo_actions.clear();
// try to merge?
if (allow_merge && !undo_actions.empty() && undo_actions.back()->merge(*action)) {
// merged with top undo action
if (allow_merge && !undo_actions.empty() &&
undo_actions.back() != save_point && // never merge with the save point
undo_actions.back()->merge(*action) // merged with top undo action
) {
delete action;
} else {
undo_actions.push_back(action);