Repository navigation
fix(MahoganyHomes): skip hotspots beyond home object count in getFixableObjects (0.0.16) - #650
Merged
chsami merged 1 commit intoOct 17, 2026
Conversation
…bleObjects (0.0.16) getFixableObjects indexed HotspotObjects.objects by Hotspot ordinal without a bounds check, so a broken hotspot 8 varbit at a 7-object home (or 7/8 at SARAH) threw ArrayIndexOutOfBoundsException and aborted the script loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Client error telemetry (ScriptErrorGroups group id 2522: 2 hits from 1 report, MahoganyHomesPlugin 0.0.13, client 2.6.33) shows the Mahogany Homes script loop crashing:
Each throw stops the whole loop iteration, including fix, finish, getNewContract, bank and walkToHome.
Root cause
getFixableObjects()maps each brokenHotspottohotspotObjects.objects[hotspot.ordinal()]and never checks the array length.Hotspothas 8 values (varbits 10554..10561), but some homes have fewer objects: ROSS, LARRY, NORMAN, TAU, BARBARA and LEELA have 7, and SARAH has 6. When hotspot 8's varbit reads broken at a 7-object home, the lookup indexes past the end of the array. The varbit can read broken because a value is left over from the previous contract or lags behind the home change. The bug is still present ondevelopment(0.0.15).Change
getFixableObjectIds(List<Hotspot>, HotspotObjects). It skips any hotspot whose ordinal is>= hotspotObjects.objects.lengthbefore indexing, andgetFixableObjects()now calls it. All three callers (fix x2, readyFurniture) go through this helper.MahoganyHomesScriptTest:Validation
./gradlew test --tests '*mahoganyhomez.MahoganyHomesScriptTest' --tests '*PluginManifestVersionTest' -PpluginList=MahoganyHomesPluginpasses: 7/7 and 1/1 tests.Known gaps
Hotspot.isEverythingFixed()andMahoganyHomesPlugin.getCompletedCount()still loop over all 8 hotspots without knowing which home is current. This throws no exception: if hotspot 8 reads broken at a 7-object home,fix()now logs "No fixable objects found", andfinish()waits for the varbit to clear. Before this fix, the same state crashed every tick. If that state turns out to last, the follow-up would be a home-awaregetBrokenHotspots(HotspotObjects)/isEverythingFixed(HotspotObjects). Telemetry so far suggests the state is short-lived.🤖 Generated with Claude Code
https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV