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,10 +113,13 @@ String PatternedNameGenerator::processRule(JsonArray const& rule, RandomSource&
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool PatternedNameGenerator::isProfane(String const& name) const {
|
bool PatternedNameGenerator::isProfane(String const& name) const {
|
||||||
auto matchName = name.toLower().rot13();
|
auto matchNames = name.toLower().rot13().splitAny(" -");
|
||||||
for (auto naughtyWord : m_profanityFilter) {
|
for (auto& naughtyWord : m_profanityFilter) {
|
||||||
if (matchName.contains(naughtyWord))
|
for (auto& matchName : matchNames) {
|
||||||
return true;
|
auto find = matchName.find(naughtyWord);
|
||||||
|
if (find != NPos && (find == 0 || naughtyWord.size() + 1 >= matchName.size()))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user