Fix Goddess of Protection - maybe (#6493)

* Fix Goddess of Protection - maybe

* Improve TextSimilarity for case-only differences
This commit is contained in:
SomeTroglodyte
2022-04-06 19:24:35 +02:00
committed by GitHub
parent a4babeda0b
commit 83327dabe8
2 changed files with 5 additions and 1 deletions

View File

@ -60,7 +60,7 @@
{ {
"name": "Goddess of Protection", "name": "Goddess of Protection",
"type": "Pantheon", "type": "Pantheon",
"uniques": ["[+30]% attacking Strength for cities"] "uniques": ["[+30]% Strength for cities <when attacking>"]
}, },
{ {
"name": "Goddess of the Hunt", "name": "Goddess of the Hunt",

View File

@ -37,6 +37,10 @@ fun getTextDistance(text1: String, text2: String): Int {
if (char1 == char2) { if (char1 == char2) {
i1++ i1++
i2++ i2++
} else if (char1.lowercaseChar() == char2.lowercaseChar()) {
dist++
i1++
i2++
} else { } else {
val firstMatchIndex1 = (i1..text1.lastIndex).firstOrNull { text1[it] == char2 } val firstMatchIndex1 = (i1..text1.lastIndex).firstOrNull { text1[it] == char2 }
val firstMatchIndex2 = (i2..text2.lastIndex).firstOrNull { text2[it] == char1 } val firstMatchIndex2 = (i2..text2.lastIndex).firstOrNull { text2[it] == char1 }