mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 00:58:33 +00:00
Refactoring bot chat and sayaction caused by group crash <NOT FINISHED>
This commit is contained in:
@@ -219,6 +219,26 @@ std::string const ChatHelper::formatMoney(uint32 copper)
|
||||
return out.str();
|
||||
}
|
||||
|
||||
std::string ChatHelper::parseValue(const std::string& type, const std::string& text)
|
||||
{
|
||||
std::string retString;
|
||||
|
||||
std::string pattern = "Hvalue:" + type + ":";
|
||||
|
||||
int pos = text.find(pattern, 0);
|
||||
if (pos == -1)
|
||||
return retString;
|
||||
|
||||
pos += pattern.size();
|
||||
|
||||
int endPos = text.find('|', pos);
|
||||
if (endPos == -1)
|
||||
return retString;
|
||||
|
||||
retString = text.substr(pos, endPos - pos);
|
||||
return retString;
|
||||
}
|
||||
|
||||
uint32 ChatHelper::parseMoney(std::string const text)
|
||||
{
|
||||
// if user specified money in ##g##s##c format
|
||||
@@ -604,4 +624,4 @@ std::set<uint32> ChatHelper::ExtractAllItemIds(const std::string& text)
|
||||
}
|
||||
|
||||
return ids;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user