Skip to content

unit.getAbilityByIndex: call BlzGetUnitAbilityByIndex - #504

Merged
Frotty merged 1 commit into
masterfrom
fix/unit-get-ability-by-index
Oct 2, 2026
Merged

Frotty merged 1 commit into
masterfrom
fix/unit-get-ability-by-index

Conversation

@Frotty

@Frotty Frotty commented Oct 2, 2026

Copy link
Copy Markdown
Member

unit.getAbilityByIndex(index) called BlzGetUnitAbility(this, index), which treats the index as an ability rawcode. It returns null for every real index, so code that walks a unit's abilities with it stops at index 0. item.getAbilityByIndex already calls BlzGetItemAbilityByIndex, and the unit version now matches it.

The wrapper has been wrong since #251. Castle Fight hit it after moving its sealed-ability-field loop onto the wrapper: no unit got its fields applied, so dummy-cast spells (Charm, Chain Shock, purges) stopped working.

No unit test: the wrapper is one native call and the interpreter has no mock for it. grill typecheck passes, and grill test passes 522/522.

It called BlzGetUnitAbility(this, index), which looks the index up as an ability rawcode and returns null for every real index, so a loop over a unit's abilities stopped at index 0. item.getAbilityByIndex already calls the ByIndex native.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T09:03:47.965814Z af4ea2a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Frotty
Frotty merged commit 05c4190 into master Oct 2, 2026
2 checks passed
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