mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-07-05 08:27:10 +02:00
Fix removal of non alpha-numeric characters from strings.
This commit is contained in:
@ -114,7 +114,7 @@ int32_t GetSkinID(StackStrF & name)
|
||||
// Clone the string into an editable version
|
||||
String str(name.mPtr, static_cast< size_t >(name.mLen));
|
||||
// Strip non-alphanumeric characters from the name
|
||||
str.erase(std::remove_if(str.begin(), str.end(), std::function<int(int)>(::isalnum)), str.end());
|
||||
str.erase(std::remove_if(str.begin(), str.end(), [](char c) -> bool { return std::isalnum(c) == 0; }), str.end());
|
||||
// Convert the string to lowercase
|
||||
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
|
||||
// See if we still have a valid name after the cleanup
|
||||
|
Reference in New Issue
Block a user