Skip to content

fix(component): isEquivalentTo nested result() returns {{bool}} (NEW-147)#55

Open
ximaks00-hue wants to merge 1 commit into
akki697222:dev-MC1.20from
ximaks00-hue:fix/new-147-container-analytics-nested-result
Open

fix(component): isEquivalentTo nested result() returns {{bool}} (NEW-147)#55
ximaks00-hue wants to merge 1 commit into
akki697222:dev-MC1.20from
ximaks00-hue:fix/new-147-container-analytics-nested-result

Conversation

@ximaks00-hue

Copy link
Copy Markdown
Contributor

Summary

  • Fixes CRITICAL parity bug NEW-147: ContainerAnalytics.isEquivalentTo wrapped the match expression in an inner result() inside the outer result(), so Lua received {{bool}} instead of bool.`n

Root cause

Port regression in ContainerAnalytics.scala — the inner result() on the boolean match arm was copied incorrectly from a refactor; Original OpenComputers 1.12 returned a plain boolean from the match with only one result() wrapper.

Fix

Remove the nested result() call; return the boolean directly from the match expression.

Test plan

  • Robot/drone isEquivalentTo(slot) returns a single boolean in Lua
  • Empty/empty slot pair still returns true

Made with Cursor

… (NEW-147)

ContainerAnalytics.isEquivalentTo wrapped the match expression in an inner result() call inside the outer result(). Lua callbacks therefore received {{bool}} instead of bool, breaking every inventory equivalence check on robots, drones, and transposers.

Original OpenComputers returned a plain boolean from the match; only the outer result() wrapper is required to marshal the Lua return value.
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