Fixing roll detection by character name

This commit is contained in:
Gonçalo Correia 2026-05-11 12:20:26 +01:00
parent ed1e696eb5
commit ab8388e27c
3 changed files with 6 additions and 3 deletions

View file

@ -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

View file

@ -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

1
docs/Changelog.md Normal file
View file

@ -0,0 +1 @@
- Fixed an issue where the wrong rolls were displayed when in a large enough group