Skip to content

Commit

Permalink
square-bracket-containing promotions are addable via visible name in …
Browse files Browse the repository at this point in the history
…dev console
  • Loading branch information
yairm210 committed Sep 15, 2024
1 parent b71b9db commit 1c5375f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/com/unciv/ui/screens/devconsole/CliInput.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ internal class CliInput(
override fun equals(other: Any?): Boolean = when {
this === other -> true
other is CliInput -> compareTo(other) == 0
other is String -> compareTo(other, method) == 0
other is String -> compareTo(other.replace("[","").replace("]",""), method) == 0
else -> false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ internal class ConsoleUnitCommands : ConsoleCommandNode {
val promotions = console.getSelectedUnit().promotions.promotions
val options = console.gameInfo.ruleset.unitPromotions.keys.asSequence()
.filter { it !in promotions }
.map { it.replace("[","").replace("]","") }
.asIterable()
return getAutocompleteString(params.lastOrNull().orEmpty(), options, console)
}
Expand Down

0 comments on commit 1c5375f

Please sign in to comment.