mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-02 15:17:27 +01:00
Core/ChatCommands: Honor exact matches during enum arg parsing (PR #25255)
This commit is contained in:
committed by
GitHub
parent
86dc58974a
commit
df29f60595
@@ -142,10 +142,13 @@ struct ArgInfo<T, std::enable_if_t<std::is_enum_v<T>>>
|
||||
if (it == SearchMap.end() || !StringStartsWith(it->first, s)) // not a match
|
||||
return nullptr;
|
||||
|
||||
auto it2 = it;
|
||||
++it2;
|
||||
if (it2 != SearchMap.end() && StringStartsWith(it2->first, s)) // not unique
|
||||
return nullptr;
|
||||
if (it->first != s) // we don't have an exact match - check if it is unique
|
||||
{
|
||||
auto it2 = it;
|
||||
++it2;
|
||||
if (it2 != SearchMap.end() && StringStartsWith(it2->first, s)) // not unique
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (it->second)
|
||||
return &*it->second;
|
||||
|
||||
Reference in New Issue
Block a user