Fix /reveal ignoring surface name when coordinates are given#114
Open
wormeyman wants to merge 1 commit into
Open
Fix /reveal ignoring surface name when coordinates are given#114wormeyman wants to merge 1 commit into
wormeyman wants to merge 1 commit into
Conversation
The reveal command resolved surface and center in a single if/elseif chain, so an explicit x,y (or GPS) match short-circuited the surface branch. As a result `/reveal <size> <surface> <x,y>` charted the caller's current surface instead of the named one, and the surface-name pattern was anchored to the whole parameter so it could never match alongside other arguments. Resolve the surface independently by scanning the post-size tokens for a valid surface name, then resolve the center separately (GPS, then x,y, then origin when only a surface was named). Surface and coordinates can now be combined in any order. Verified by executing the parsing logic against nine input variants, including the original failing case and console (no-player) invocation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SqUp4baDTeLBFeYWQgEb9R
Contributor
Author
|
It's late and I had claude generate this for me. I have always used |
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
/reveal <size> <surface> <x,y>(e.g./reveal 2048 vulcanus 0,0) silently charted the caller's current surface instead of the named one. The command resolved surface and center in a singleif/elseifchain, so an explicitx,y(or GPS) match short-circuited the surface branch. The bare surface-name pattern was also anchored to the whole parameter (^...$), so it could never match alongside any other argument.This has been the behavior since the multi-arg forms were introduced in
4c89aa7(2025-05-27) - it is not a 2.1 regression; the combined form never worked.Fix
surfnamepattern.[surface]argument and the order-independence.Verification
size/surface/center.commands.luaunder genuine Lua 5.2 (nickblah/lua:5.2-alpine), per AGENTS.md.Key results:
2048 vulcanus 0,0(the bug)2048 vulcanus 100,-200vulcanus2048(player at 500,-300)2048 [gps=0,0,vulcanus]Bumped
version.luato662-07.02.2026-849pper the AGENTS.md versioning convention.🤖 Generated with Claude Code