Fix some issues with unit tracking when leaving combat.

Mere [06-24-13 - 19:13]
Fix some issues with unit tracking when leaving combat.
Filename
RaidManagement.lua
RaidManagement_LibUnitChange.lua
RiftAddon.toc
diff --git a/RaidManagement.lua b/RaidManagement.lua
index 9fbddd5..e013308 100644
--- a/RaidManagement.lua
+++ b/RaidManagement.lua
@@ -97,7 +97,7 @@ function playerInfo:new(settings, unitId, spec)
 	end

 	local currentSpecifier = MereHealingFrames.RaidManagement.Specifiers[this.specifier]
-	if currentSpecififier and currentSpecifier.isFake then
+	if currentSpecifier and currentSpecifier.isFake then
 		currentSpecifier:delete()
 	end

@@ -113,6 +113,13 @@ function playerInfo:new(settings, unitId, spec)
 end

 function playerInfo:changeSpecifier(spec)
+    playerInfo:Active()
+
+    if (self.specifier == spec) then
+        -- happens when loading, the saved frames are present, then the scanned ones are primed
+        return
+    end
+
     if MereHealingFrames.RaidManagement.Specifiers[self.specifier] == self then
         MereHealingFrames.RaidManagement.Specifiers[self.specifier] = nil
     end
@@ -121,6 +128,10 @@ function playerInfo:changeSpecifier(spec)
 	self.grouping = calculateGrouping(spec)
 end

+function playerInfo:Active()
+    self.FromSave = false
+end
+
 function playerInfo:delete()
 	MereHealingFrames.RaidManagement.Units[self.unitId] = nil
 	MereHealingFrames.RaidManagement.Specifiers[self.specifier] = nil
@@ -543,10 +554,6 @@ function MereHealingFrames.RaidManagement.RemoveFakes()
             layout:ProcessPendingLayoutChanges()
         end
     end
-
-	if not LibSRM.Grouped() then
-		MereHealingFrames.Events.GroupChange({}, MereHealingFrames.PlayerId, "group01", "player")
-	end
 end

 function MereHealingFrames.RaidManagement.EnterCombat()
diff --git a/RaidManagement_LibUnitChange.lua b/RaidManagement_LibUnitChange.lua
index c06110b..3e63218 100644
--- a/RaidManagement_LibUnitChange.lua
+++ b/RaidManagement_LibUnitChange.lua
@@ -42,11 +42,6 @@ function MereHealingFrames.Events.GroupChange (handle, UnitId, oldSpec, newSpec)
     BumpEventCounter("Event.Group.Change")
     MereHealingFrames.Debug(4, "GroupChange: %s, %s, %s", UnitId, oldSpec, newSpec)

-    if (oldSpec == newSpec) then
-        -- happens when loading, the saved frames are present, then the scanned ones are primed
-        return
-    end
-
     local playerInfo = RMUnits[UnitId]
     if (playerInfo) then
         playerInfo:changeSpecifier(newSpec)
@@ -61,7 +56,9 @@ function MereHealingFrames.Events.PlayerSolo (handle)
     BumpEventCounter("Event.PlayerSolo")

     local playerInfo = RMUnits[MereHealingFrames.PlayerId]
+
     if (playerInfo ~= nil) then
+        playerInfo:Active()
         return
     end

diff --git a/RiftAddon.toc b/RiftAddon.toc
index 71a2bdc..7765503 100644
--- a/RiftAddon.toc
+++ b/RiftAddon.toc
@@ -7,7 +7,7 @@ Name = "Mere Healing Frames"
 NameShort = "MHF"
 Description = "A set of healing frames"
 Author = "Mere"
-Version = "0.4.26"
+Version = "0.4.27"
 Email = "rift@dokein.co.uk"
 Environment = "2.3"