Skip to content

Give each action registration its own trigger - #528

Merged
Frotty merged 1 commit into
masterfrom
fix-action-registration-trigger
Nov 15, 2026
Merged

Frotty merged 1 commit into
masterfrom
fix-action-registration-trigger

Conversation

@Frotty

@Frotty Frotty commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Problem

A registration with an action, registerPlayerUnitEvent(p, filter, condition, action) (and registerPlayerEvent(p, condition, action)), put its condition and action on the event's shared trigger. On that trigger every condition has to hold for the actions to run. A listener which returns nothing counts as a condition that does not hold, on Jass and on Lua. So any such listener of the same event stopped every action registered on it.

LastOrder registers exactly such a listener on point, target and immediate orders. In any map that imports it, in-game test 20 ("a condition gates the action registered with it") failed: the action never ran although its condition held. It fails on master in a plain build of the repository's ExampleMap, on both backends.

Change

  • Each registration with an action gets a trigger of its own for the event, with only its condition and action. It uses the event's filter, now kept as a filterfunc. Its condition gates its own action and nothing else.
  • Registrations with an action no longer seal the shared trigger, so the Lua listener bridge stays in place for those events. getPlayerUnitEventTrigger still seals, unchanged.
  • Test 20 now registers its own listener which returns nothing on the point order, before the action registration. The test no longer depends on whether the map imports LastOrder.

Evidence

Warcraft III 3.0.1.24371, the in-game suite run automatically in a test map, before and after on each backend.

Lua:

  • Before: this PR's tests on master's RegisterEvents failed 1 of 144 checks: the action ran, as its condition held (0).
  • After, c82afb5: the suite twice in one game, both runs judged, passed. First run 144/144, second 138/138 with 6 checks that only run once skipped. Test 20: listener 1, listener returning nothing 1, gated action 1, denied action 0.

Jass (a test map holding only the in-game suite):

  • Before: this PR's tests on master's RegisterEvents failed 1 of 118 checks: the action ran, as its condition held (0).
  • After, c82afb5: 118/118. Test 20: listener 1, listener returning nothing 1, gated action 1, denied action 0.
  • A plain build of the repository's ExampleMap on master also fails only this check (116/117).

Both backends catch the same 4 errors inside try() before and after; none is uncaught.

Other checks:

  • grill typecheck --quiet passed. grill test --quiet passed 771/771.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T09:28:55.304754Z c82afb5 Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c82afb530d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread wurst/StdlibIngameEventTests.wurst Resolved
@Frotty

Frotty commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: c82afb530d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Frotty
Frotty merged commit de5c77b into master Nov 15, 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