Skip to content

Commit 5691eb1

Browse files
committed
Fix protagonist names while compiling against Dimbreath's repo.
1 parent 2b6c4eb commit 5691eb1

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

Sources/GachaMetaGeneratorModule/Components/Protagonist.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,6 @@ extension GachaMetaGenerator {
2727
}
2828
}
2929

30-
public init?(against target: GachaItemMeta) {
31-
// Genshin Impact Protagonist Scenario.
32-
if target.id > 114514, let genshinProtagonist = Self(rawValue: target.id) {
33-
self = genshinProtagonist
34-
}
35-
guard let map = target.l10nMap else { return nil }
36-
// The rest must be either HSR protagonist or nothing.
37-
guard map.description.contains(#"{NICKNAME}"#)
38-
|| map.description.contains("Trailblazer")
39-
else { return nil }
40-
self = (target.id % 2 == 0) ? .ofStelle : .ofCaelus
41-
}
42-
4330
// MARK: Public
4431

4532
public var nameTranslationDict: [String: String] {

Sources/GachaMetaGeneratorModule/GeneratorAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ extension GachaMetaGenerator {
6767
guard let dict = dictAll[localeID.langTag]?[hashKey] else { return }
6868
if currentItem.l10nMap == nil { currentItem.l10nMap = [:] }
6969
currentItem.l10nMap?[localeID.langTag] = dict
70-
if let matchedProtagonist = Protagonist(against: currentItem) {
70+
if let matchedProtagonist = Protagonist(rawValue: currentItem.id) {
7171
currentItem.l10nMap = matchedProtagonist.nameTranslationDict
7272
}
7373
items[theIndex] = currentItem

0 commit comments

Comments
 (0)