fix(scripting): supply ZoneCompletePct to script-rendered maps - #602
Merged
Conversation
The maps/map template formats the title with a zone-completion percent (%d). The 'map' command supplies it, but GetMap (used by map signs and other scripted maps) did not — so the template formatted a nil and leaked '%!d(<nil>)' into the title (e.g. 'Map of Frostfang (%!d(<nil>)%)'). GetMap has no viewing user to measure against, so default to 0, matching the map command's own fallback. Script-rendered map titles now read e.g. 'Map of Frostfang (0%)'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Volte6
approved these changes
Jun 6, 2026
Contributor
Author
|
Same here. I don't seem to have permissions to run the CI tests. |
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.
PR: fix
%!d(<nil>)in script-rendered map titlesDescription
Looking at a map sign (or any map produced by the
GetMapscriptingfunction) renders a broken title — e.g.
Map of Frostfang (%!d(<nil>)%)— insteadof a percentage.
The shared
maps/maptemplate formats the title with a zone-completion percent:printf "%s (%d%%)" .Title .ZoneCompletePct. Themapcommand suppliesZoneCompletePct, butGetMap(internal/scripting/room_func.go, used by mapsigns and other scripted maps) did not — so the template formatted
nilwith%dand leaked%!d(<nil>)into the title.Reproducible with a raw telnet client (no special client) via
look <map sign>in Frostfang's Town Square — so it is not a client/encoding artifact.
GetMaphas no viewing user to measure exploration against (unlike themapcommand), so it now defaults
ZoneCompletePctto0, matching themapcommand's own fallback (
internal/usercommands/skill.map.go). Script-renderedmap titles now read e.g.
Map of Frostfang (0%).Changes
internal/scripting/room_func.go—GetMapnow includesZoneCompletePct: 0in the template data passed to
maps/map, preventing the%!d(<nil>)leak.Notes
0is the minimal, safe default that matches existing behavior; maintainers mayprefer signs to show the viewing player's actual exploration percent (would
require threading a user into
GetMap) or to omit the percent for static signs —happy to adjust. Found by an AI playtest harness driving a
bug-finderpersonality (verified server-side with a raw socket client).