Fixing roll detection by character name
This commit is contained in:
parent
ed1e696eb5
commit
ab8388e27c
3 changed files with 6 additions and 3 deletions
6
Roll.lua
6
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue