The string-column auto-detector in both tools had two gaps that caused small
integer fields (RaceID=1, SexID=0/1, BaseSection, ColorIndex) to be falsely
classified as string columns, corrupting the generated CSVs:
1. No boundary check: a value of N was accepted as a valid string offset even
when N landed inside a longer string (e.g. offset 3 inside "Character\...").
Fix: precompute valid string-start boundaries (offset 0 plus every position
immediately after a null byte); reject offsets that are not boundaries.
2. No diversity check: a column whose only non-zero value is 1 would pass the
boundary test because offset 1 is always a valid boundary (it follows the
mandatory null at offset 0). Fix: require at least 2 distinct non-empty
string values before marking a column as a string column. Columns like
SexID (all values are 0 or 1, resolving to "" and the same path fragment)
are integer fields, not string fields.
Both dbc_to_csv and asset_extract now produce correct column metadata,
e.g. CharSections.dbc yields "strings=6,7,8" instead of "strings=0,1,...,9".
dbc_to_csv: The string-column auto-detector would mark integer fields (e.g.
RaceID=1, SexID=0, BaseSection=0-4) as string columns whenever their small
values were valid string-block offsets that happened to land inside longer
strings. Fix by requiring that an offset point to a string *boundary* (offset
0 or immediately after a null byte) rather than any valid position — this
eliminates false positives from integer fields whose values accidentally alias
path substrings. Affected CSVs (CharSections, ItemDisplayInfo for Classic/TBC)
can now be regenerated correctly.
game_handler: clearDBCCache() is already called by application.cpp before
resetDbcCaches(), but also add it inside resetDbcCaches() as a defensive
measure so that future callers of resetDbcCaches() alone also flush stale
expansion-specific DBC data (CharSections, ItemDisplayInfo, etc.).