Skip to content

Refactor enemy name matching logic and remove legacy code for improved performance#15

Open
seekey13 wants to merge 1 commit into
mainfrom
ponytail
Open

Refactor enemy name matching logic and remove legacy code for improved performance#15
seekey13 wants to merge 1 commit into
mainfrom
ponytail

Conversation

@seekey13

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 20, 2026 10:39
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@seekey13, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 6 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd3e7342-dcdd-4cbc-b8c5-ed02c37ce479

📥 Commits

Reviewing files that changed from the base of the PR and between d711b76 and f18b3e7.

📒 Files selected for processing (5)
  • AMANTracker.lua
  • lib/family.lua
  • lib/packet_handler.lua
  • lib/parser.lua
  • lib/tracker_ui.lua
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ponytail

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors and trims legacy code paths related to enemy name matching and UI rendering, aiming to simplify logic and reduce unnecessary work during tracking and display.

Changes:

  • Removes legacy/fallback enemy name matching logic and relies on match_type-driven matching.
  • Simplifies tracker_ui GDI-font rendering by removing the extra progress_text GDI object and related font settings.
  • Cleans up unused legacy functions and duplicate data definitions (parser legacy line parser, unused player-id helper, duplicate Bat/Bats family entry).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/tracker_ui.lua Removes legacy GDI progress text objects/font settings; keeps progress rendering via ImGui progress bar.
lib/parser.lua Removes unused legacy parse_enemy_line function.
lib/packet_handler.lua Removes unused get_player_id() and related unused local variable.
lib/family.lua Removes duplicate family key entry (introduces a potential regression for plural family names).
AMANTracker.lua Removes legacy enemy matching fallback; minor cleanup of parsing start and regime confirmation output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/family.lua
Comment on lines 59 to 62
["Bat"] = {
includes = { "Bat", "Bats", "Stirge", "Gaylas" },
excludes = { "Gigas's", "Goblin's" }
},
Comment thread AMANTracker.lua
Comment on lines 196 to 200
-- Try ies -> y transformation (e.g., defeated "Damselfly", list has "Damselflies")
if enemy_name:sub(-1) == "y" and enemy.name == enemy_name:sub(1, -2) .. "ies" then
return enemy, i;
end
else
-- Legacy support: no match_type specified, try all methods

-- Exact match
if enemy.name == enemy_name then
return enemy, i;
end

-- Check if enemy.name is a family pattern
local family_type = family.extract_family_type(enemy.name);
if family_type then
if family.is_family_member(enemy_name, family_type) then
return enemy, i;
end
end

-- Try singular/plural variations
if enemy.name == enemy_name .. "s" then
return enemy, i;
end
if enemy.name == enemy_name .. "es" then
return enemy, i;
end
if enemy.name:sub(-1) == "s" and enemy.name:sub(1, -2) == enemy_name then
return enemy, i;
end
if enemy.name:sub(-2) == "es" and enemy.name:sub(1, -3) == enemy_name then
return enemy, i;
end

-- Try y -> ies transformation
if enemy.name:sub(-3) == "ies" and enemy.name:sub(1, -4) .. "y" == enemy_name then
return enemy, i;
end
if enemy_name:sub(-1) == "y" and enemy.name == enemy_name:sub(1, -2) .. "ies" then
return enemy, i;
end
end
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.

2 participants