Open misternobousi opened 5 months ago
I'm not really sure what you mean here..
It's a very dirty code and I don't want you to imitate it, but this is what I mean.
foreach (var entry in entries) {
int fixIndex;
// NaN specifies this is a gender based entry
if (entry.Replace("\r", "").Length == 3 && char.IsDigit(entry[0])) {
int genderIndex;
if (int.TryParse(entry.Substring(0, 1), out genderIndex)) {
var genderTag = DetermineGender(fixes[genderIndex]);
if (int.TryParse(entry.Substring(2, 1), out fixIndex)) {
itemName[pos] = GetGendered(fixes[fixIndex], genderTag);
}
}
pos++;
}
// 'sN'
else if (entry.Replace("\r", "").Length == 2) {
if (int.TryParse(entry.Replace("s", "").Replace("\r", ""), out fixIndex)) {
itemName[pos] = FilterGenderTag(fixes[fixIndex]);
}
pos++;
}
}
I'm really sorry! The code I just wrote didn't fix it! The fix was probably a bug, just a coincidence! (I hit the language switch button too many times.) The Replace had to be placed right after the foreach. It gets sucked up by the if above. Anyway, \r should not be mixed in, so please create a local variable and Replace!
Originally posted by @misternobousi in https://github.com/marius00/iagd/issues/141#issuecomment-2002333799