Repository navigation
fix(PVirewatchKiller): skip loop and overlay until fight area is set (1.0.5) - #645
Merged
chsami merged 3 commits intoOct 16, 2026
Merged
Conversation
The script loop starts with no initial delay and dereferenced plugin.fightArea before the first GameTick assigned it, and again after the plugin stop hook cleared it. Read the player location once with a null guard, snapshot fightArea and startingLocation, and return early while any of them is missing. Compare WorldPoints with equals instead of identity so the return-to-start branch is no longer always taken. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV
…s set Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV
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 group 2413 (PVirewatchKiller 1.0.4, Microbot 2.6.32): 3 occurrences across 1 report, all on 2026-10-16.
Root cause
PVirewatchKillerPlugin.fightAreastarts outnull. It is only assigned inonGameTickoncestartingLocationhas been captured, or inonConfigChanged.shutDown()sets it back tonull. The script loop runs on its own scheduler and calledplugin.fightArea.contains(...)without a null check. That throws before the first GameTick after start, and again after shutdown clears the field. The overlay's NPC outline block had the same unguarded dereference, so it hit an NPE on every frame betweenstartUp()adding the overlay and the first tick.Change
PVirewatchScript: each iteration reads the local player location,fightAreaandstartingLocationonce, and returns early while any of them is null (thehasFightStatehelper). The rest of the iteration uses those locals.PVirewatchScript: the "away from start" check used!=onWorldPoint, which compares identity and so was always true. It now usesequals()(theisAwayFromStarthelper). This is a small behaviour change:walkTois now skipped when the player is already on the start tile. Before, it was called with distance 0, which did nothing.PVirewatchKillerOverlay.render: readsplugin.fightAreainto one local per frame. Both the fight-area tile loop and the NPC outline block use that local and run only when it is non-null. AshutDown()mid-frame can therefore no longer cause an NPE.Validation
./gradlew build -PpluginList=PVirewatchKillerPlugin test --tests '*PVirewatchScriptTest*': BUILD SUCCESSFULPVirewatchScriptTest: 5 tests, 0 failures. Covers the null fight area or start location before the first tick, the missing local player, and theequals-based start tile comparison.Known gaps
render()depend on Microbot statics and the NPC cache, so they are not unit-tested and have not been run against a live client.onGameTickstill callsgetLocalPlayer()without a null check. No telemetry reports point there, so it is out of scope.🤖 Generated with Claude Code
https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV