Make the profanity filter not as insanely strict as Warframe's
The profanity filter sucks. Male glitch have a possibility of generating with "Brass" at the start that is never allowed because "ASS"!! and human names Cassie and Cassidy also never pass because of this.
This commit is contained in:
parent
fd915ce672
commit
7c68b8f4af
@ -113,11 +113,14 @@ String PatternedNameGenerator::processRule(JsonArray const& rule, RandomSource&
|
||||
}
|
||||
|
||||
bool PatternedNameGenerator::isProfane(String const& name) const {
|
||||
auto matchName = name.toLower().rot13();
|
||||
for (auto naughtyWord : m_profanityFilter) {
|
||||
if (matchName.contains(naughtyWord))
|
||||
auto matchNames = name.toLower().rot13().splitAny(" -");
|
||||
for (auto& naughtyWord : m_profanityFilter) {
|
||||
for (auto& matchName : matchNames) {
|
||||
auto find = matchName.find(naughtyWord);
|
||||
if (find != NPos && (find == 0 || naughtyWord.size() + 1 >= matchName.size()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user