Skip to content

Fix bugs: event handlers, variable shadowing, performance#2

Open
GabHST wants to merge 1 commit intopumpan:mainfrom
GabHST:fix/bug-fixes
Open

Fix bugs: event handlers, variable shadowing, performance#2
GabHST wants to merge 1 commit intopumpan:mainfrom
GabHST:fix/bug-fixes

Conversation

@GabHST
Copy link
Copy Markdown

@GabHST GabHST commented Apr 3, 2026

Summary

Bug fixes for FillRaidBots addon on WoW 1.12.1:

  • MODIFIER_STATE_CHANGED handlers broken — used function(_, _, key, state) parameter style which doesn't work in 1.12.1 (args come from globals arg1/arg2). Ctrl+Alt click-to-fill from boss target never worked. Fixed both keyboardFrame and detectBossEventFrame handlers.
  • GROUP_ROSTER_UPDATE doesn't exist in 1.12.1 — replaced with PARTY_MEMBERS_CHANGED (RAID_ROSTER_UPDATE was already registered).
  • Variable shadowingbotCount, initialBotRemoved, firstBotName, messageQueue declared twice with local, creating two independent sets. Code before line 249 used one set, code after used another. Removed local from second declarations.
  • restoreFrame shadowing — two separate restoreFrame frames created. ToggleSoundEffectsVolume("restore") used the first, RefillBots used the second. Renamed second to refillRestoreFrame.
  • print() doesn't exist in 1.12.1 — replaced all print() calls with DEFAULT_CHAT_FRAME:AddMessage() in both FillRaidBots.lua and debugger.lua.
  • Performance: guild/friend list rebuilt inside loopsbuildGuildRoster() and buildFriendList() were called inside for i = 1, GetNumRaidMembers() loop (up to 40x per check). Moved before the loop.
  • Tooltip anchors wrong — Group Loot and Master Loot tooltip anchored to FFA checkbox instead of their own.
  • Implicit globalstotalHealers and totaly lacked local, polluting global namespace.
  • PresetPopup OnHide invertedremoveButton:Show() when no preset selected, should be Hide().
  • Debugger timestamps missingGetTimestamp() was defined but never called in DebugMessage().
  • Removed duplicate generateTooltip/regenerateTooltips definitions in Presets.lua (first pair was dead code).
  • Fixed "automaticaly" typo → "automatically"

Test plan

  • Ctrl+Alt click on boss target with preset popup open — verify auto-fill works
  • Fill a raid, verify bot count logic works correctly (no variable desync)
  • After refill, verify sound volume restores properly
  • Check debugger messages have timestamps
  • Hover Group Loot / Master Loot checkboxes — tooltip should appear next to the correct checkbox
  • Open /frbdebug — verify no Lua errors from print()

- Fix variable shadowing: botCount, initialBotRemoved, firstBotName, messageQueue were declared twice with local
- Fix restoreFrame shadowing: renamed second instance to refillRestoreFrame to prevent sound restore conflicts
- Fix print() calls: replaced with DEFAULT_CHAT_FRAME:AddMessage() (print doesn't exist in 1.12.1)
- Fix event handler signatures: MODIFIER_STATE_CHANGED handlers used named params instead of arg1/arg2 globals (1.12.1 API)
- Fix GROUP_ROSTER_UPDATE: doesn't exist in 1.12.1, replaced with PARTY_MEMBERS_CHANGED
- Fix tooltip anchors: Group Loot and Master Loot tooltips were anchored to FFA checkbox
- Fix performance: moved buildGuildRoster() and buildFriendList() outside raid/party member loops
- Fix totalHealers implicit global: added local keyword
- Fix totaly implicit global: declared at file scope
- Fix PresetPopup OnHide: removeButton:Show() -> Hide() when no preset selected
- Fix "automaticaly" typo -> "automatically"
- Remove duplicate generateTooltip/regenerateTooltips definitions in Presets.lua
- Fix debugger timestamp: GetTimestamp() was defined but never called
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant