Skip to content

Fall back when a bundle could not resolve Fungle's door offset - #419

Open
greluc wants to merge 1 commit into
OhMyGuus:nightlyfrom
greluc:fix/fungle-door-unresolved-offset
Open

greluc wants to merge 1 commit into
OhMyGuus:nightlyfrom
greluc:fix/fungle-door-unresolved-offset

Conversation

@greluc

@greluc greluc commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

On 32-bit Among Us 2023.7.11, Fungle's doors are read from offset -1.

Why

#410 reads the Fungle's doors from mushroomDoor_isOpen and falls back to door_isOpen:

const isOpenOffset =
	map === MapType.FUNGLE
		? (this.offsets.mushroomDoor_isOpen ?? this.offsets.door_isOpen)
		: this.offsets.door_isOpen;

A bundle that could not resolve the field does not omit it, though — it publishes -1, which is the generator's marker for a lookup that failed. -1 is not nullish, so ?? hands it straight to the read.

One published bundle is in that state, and it is the one that matters: x86 V2023.7.11, which serves broadcast 50585000 — the build the Fungle arrived in. Its x64 sibling omits the field entirely and falls back correctly, which is why this shows only on 32-bit.

What changed

The field is used only when it actually resolved:

const mushroomDoorIsOpen = this.offsets.mushroomDoor_isOpen;
const isOpenOffset =
	map === MapType.FUNGLE && mushroomDoorIsOpen !== undefined && mushroomDoorIsOpen >= 0
		? mushroomDoorIsOpen
		: this.offsets.door_isOpen;

Verification

The decision is extracted from GameReader.ts and run over every bundle the mirror publishes that can load the map, so the same script runs against either revision.

bundle nightly this branch
x86 V2023.7.11 (broadcast 50585000) uses -1 uses 20
x64 V2023.7.11 uses 32 uses 32
the other 14 bundles real values unchanged
a non-Fungle map door_isOpen door_isOpen

Sixteen bundles checked: one read from an unresolved offset before, none after.

lint, typecheck, format:check, verify:esm and build pass, and prettier reports the file unchanged. CI was run on a fork before this was opened — lint and both platform builds green.

Why here and not in the offsets repository

The -1 could be removed from that one bundle instead, and then ?? would do its job. Two reasons this is the better place:

  • A corrected bundle does not reach a client that has already cached the old one. fetchOffsets serves the cache whenever the filename and offsetsVersion match, so the fix would arrive only after that version is bumped, and not at all for someone offline.
  • The guard also covers any bundle that carries -1 later, which is the same failure returning by the same route.

Happy to send the data change as well if you would rather have both.

Limits, stated plainly

Nothing here was run against Among Us, so what is verified is which number the code selects, not what that number means once it is read. The offsets and the ?? />= 0 semantics are the whole of the claim.

Disclaimer

This change was written with AI assistance (Claude Code). The author reviewed it, and the before/after table is real output from a script driving the real function, not a description of what it should do. Please review it as you would any patch from a stranger; if something here is wrong I would rather hear it than have it merged.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Download the artifacts for this pull request:


This service is provided by nightly.link. These artifacts will expire in 90 days and will not be available for download after that time.

OhMyGuus#410 reads Fungle's doors from mushroomDoor_isOpen and falls back to door_isOpen
with ??. A bundle that could not resolve the field does not omit it though, it
publishes -1, and -1 is not nullish, so the fallback never runs and the door
state is read from offset -1.

One published bundle is in that state: x86 V2023.7.11, which serves broadcast
50585000 -- the build the Fungle arrived in. Its x64 sibling omits the field
entirely and falls back correctly, which is why this only shows on 32-bit.

The field is used now only when it actually resolved. Checked by extracting the
decision from GameReader and running it over every bundle the mirror publishes
that can load the map: sixteen of them, one reading from -1 before and none
after, with the other fifteen unchanged and non-Fungle maps still on
door_isOpen.

Fixing it here rather than in the offsets repository is deliberate. A corrected
bundle does not reach a client that has already cached the old one, and this
guard also covers any bundle that carries -1 later.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Lucas Greuloch (greluc) <lucas.greuloch@gmail.com>
@greluc
greluc force-pushed the fix/fungle-door-unresolved-offset branch from 274e0bc to a5258be Compare September 9, 2026 11:20
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