Skip to content

Instantly share code, notes, and snippets.

View wilrodriguez's full-sized avatar

Wil Rodriguez wilrodriguez

  • Enlighten IT Consulting
  • San Antonio, Texas
  • 20:19 (UTC -12:00)
View GitHub Profile
@wilrodriguez
wilrodriguez / README.md
Created July 11, 2026 17:59
Allow KCD Cheat Xtended to accept string literals

CheatXtended Exact Match & Quote Literal Patch

This patch adds support for exact matches to the CheatXtended mod console commands. It resolves ambiguities when two NPC or faction names are sub-strings of one another (e.g., rat_tailor vs. rat_tailors_wife).

NOTE: I generated this patch with AI, I don't know if it works, and it probably should be reviewed by a human who knows C++ better than I do. I haven't touched C++ since college, and I wasn't very good at it then either.

What this patch does:

  1. Prioritizes Exact Matches: When you run a command (like cheatx_set_opinion), the mod first checks if there is a case-insensitive exact match for the name you typed. If it finds one, it immediately targets that NPC/faction and ignores any other substring matches, resolving the ambiguity automatically without needing quotes.
  2. Quote Handling (CleanQuery): If you pass an argument wrapped in single (') or double (") quotes, the mod cleans the quotes and forces an exact-match check (d