diff --git a/RelationshipsPVP.lua b/RelationshipsPVP.lua index 0282370..7b38a39 100644 --- a/RelationshipsPVP.lua +++ b/RelationshipsPVP.lua @@ -226,9 +226,18 @@ local function RegisterDeath() local db = EnsureDB() if not db.currentMatch or db.currentMatch.key ~= currentBG then db.currentMatch = { key = currentBG, killedBy = {} } + -- Fresh match: reset the "last match" tally so the Nemesis line + -- starts from zero and updates live as deaths accumulate. + db.lastMatchKilledBy = {} + db.lastMatchKey = currentBG end local n = lastAttackerName db.currentMatch.killedBy[n] = (db.currentMatch.killedBy[n] or 0) + 1 + -- Live update: promote this death straight into the "last match" and + -- all-time KOS tables so the UI reflects it immediately, instead of + -- waiting until FinalizeMatchKillers() runs at match end. + db.lastMatchKilledBy[n] = (db.lastMatchKilledBy[n] or 0) + 1 + db.killedByAll[n] = (db.killedByAll[n] or 0) + 1 end -- Called when we transition out of a BG: promote currentMatch tallies to @@ -236,18 +245,9 @@ end local function FinalizeMatchKillers() local db = RelationshipsPVPCharDB if not db or not db.currentMatch then return end - local cm = db.currentMatch - local hasAny = false - local newLast = {} - for name, cnt in pairs(cm.killedBy or {}) do - newLast[name] = cnt - db.killedByAll[name] = (db.killedByAll[name] or 0) + cnt - hasAny = true - end - if hasAny then - db.lastMatchKilledBy = newLast - db.lastMatchKey = cm.key - end + -- Deaths are now folded into lastMatchKilledBy / killedByAll live in + -- RegisterDeath(), so there's nothing to promote here -- just clear + -- the in-progress match marker. db.currentMatch = nil end