From ab8388e27c6bc5038fc5fcb13ec923f97f5c4d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Correia?= Date: Mon, 11 May 2026 12:20:26 +0100 Subject: [PATCH] Fixing roll detection by character name --- AltSystem.toc | 2 +- Roll.lua | 6 ++++-- docs/Changelog.md | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 docs/Changelog.md diff --git a/AltSystem.toc b/AltSystem.toc index 0b03820..e541ac4 100644 --- a/AltSystem.toc +++ b/AltSystem.toc @@ -2,7 +2,7 @@ ## Title: AltSystem ## Notes: Enhances RP gameplay with a custom rolling system ## Author: Rukira -## Version: 1.0 +## Version: 1.1 ## Dependencies: totalRP3, totalRP3_Extended ## SavedVariables: AltSystemDB diff --git a/Roll.lua b/Roll.lua index 1e98b0c..a37ca8b 100644 --- a/Roll.lua +++ b/Roll.lua @@ -78,8 +78,9 @@ rollListener:RegisterEvent("CHAT_MSG_SYSTEM") rollListener:SetScript("OnEvent", function(self, event, message) -- Phase 2: waiting for pet/summon roll result (1-5) if pendingPetRoll then - local petRoll = message:match("rolls (%d+) %(1%-5%)") + local petRoller, petRoll = message:match("(.+) rolls (%d+) %(1%-5%)") if not petRoll then return end + if petRoller ~= UnitName("player") then return end local petValue = tonumber(petRoll) local info = pendingPetRoll @@ -93,8 +94,9 @@ rollListener:SetScript("OnEvent", function(self, event, message) if not pendingRollType then return end -- Match the roll result pattern: "PlayerName rolls X (1-20)" - local roll = message:match("rolls (%d+) %(1%-20%)") + local roller, roll = message:match("(.+) rolls (%d+) %(1%-20%)") if not roll then return end + if roller ~= UnitName("player") then return end local rollValue = tonumber(roll) local rollType = pendingRollType diff --git a/docs/Changelog.md b/docs/Changelog.md new file mode 100644 index 0000000..dad8bdc --- /dev/null +++ b/docs/Changelog.md @@ -0,0 +1 @@ +- Fixed an issue where the wrong rolls were displayed when in a large enough group \ No newline at end of file