Skip to content

Fix debug command for talking to towners#7826

Merged
AJenbo merged 1 commit intodiasurgical:masterfrom
StephenCWills:dbg-talk-to-towner
Mar 10, 2025
Merged

Fix debug command for talking to towners#7826
AJenbo merged 1 commit intodiasurgical:masterfrom
StephenCWills:dbg-talk-to-towner

Conversation

@StephenCWills
Copy link
Copy Markdown
Member

DebugTalkToTowner() is currently no longer able to find any towners at all. This is because it searches by towner name, but townerData.init() doesn't populate towner.name. It needs to invoke InitTownerInfo(), but it can't do that since that function requires us to pass an index to the Towners array.

Incidentally, the DebugCmdVisitTowner() function uses a lookup table to find towners not only by name, but also by shortened descriptions such as smith, witch, or bmaid. The only downside is that it's not case-insensitive, but I figure someone can add that if they need it.

This PR splits the InitTownerInfo() function in two so that DebugTalkToTowner() can pass a Towner instance that is not a member of the Towners array. It also updates DebugCmdTalkToTowner() to use the same logic as DebugCmdVisitTowner() to make the towner search logic a bit more consistent.

@AJenbo AJenbo merged commit 390d760 into diasurgical:master Mar 10, 2025
23 checks passed
@StephenCWills StephenCWills deleted the dbg-talk-to-towner branch March 10, 2025 02:52
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.

2 participants