Only remove parent if the entity doesn't appear elsewhere in the members list.
authorAndy Allan <andy@gravitystorm.co.uk>
Tue, 29 Mar 2011 19:34:04 +0000 (20:34 +0100)
committerAndy Allan <andy@gravitystorm.co.uk>
Tue, 29 Mar 2011 19:34:04 +0000 (20:34 +0100)
net/systemeD/halcyon/connection/actions/AddMemberToRelationAction.as

index 7f4b729..a5d9a68 100644 (file)
@@ -29,7 +29,9 @@ package net.systemeD.halcyon.connection.actions {
         
         public override function undoAction():uint {
             memberList.splice(index, 1);
-            member.entity.removeParent(rel);
+            if (rel.findEntityMemberIndex(member.entity)==-1) {
+                member.entity.removeParent(rel);
+            }
             markClean();
             rel.dispatchEvent(new RelationMemberEvent(Connection.RELATION_MEMBER_REMOVED, member.entity, rel, index));