mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-06-02 21:45:13 -05:00
fix skip count
start counting from the last possible match of the first letter, causes a lower skip count that way
This commit is contained in:
parent
2c25e69aa9
commit
55a0ecf631
|
|
@ -251,6 +251,7 @@ namespace HavenSoft.HexManiac.Core {
|
|||
/// </summary>
|
||||
public static int SkipCount(this string full, string partial) {
|
||||
int j = 0, skipCount = 0;
|
||||
partial = partial.ToUpper();
|
||||
|
||||
for (int i = 0; i < partial.Length; i++) {
|
||||
var testPartial = char.ToUpperInvariant(partial[i]);
|
||||
|
|
@ -262,6 +263,7 @@ namespace HavenSoft.HexManiac.Core {
|
|||
if (full[j] == 'á') testFull = 'A';
|
||||
j++;
|
||||
if (testFull == testPartial) break;
|
||||
if (testFull == partial[0] && i == 1) skipCount = 0;
|
||||
if (j == full.Length) return skipCount;
|
||||
if (i > 0) skipCount++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user