mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 09:07:19 +00:00
[Crash fix[ Custom cast spell
This commit is contained in:
@@ -9,14 +9,14 @@
|
|||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
#include "ServerFacade.h"
|
#include "ServerFacade.h"
|
||||||
|
|
||||||
uint32 FindLastSeparator(std::string const text, std::string const sep)
|
size_t FindLastSeparator(std::string const text, std::string const sep)
|
||||||
{
|
{
|
||||||
size_t pos = text.rfind(sep);
|
size_t pos = text.rfind(sep);
|
||||||
if (pos == std::string::npos)
|
if (pos == std::string::npos)
|
||||||
return pos;
|
return pos;
|
||||||
|
|
||||||
uint32 lastLinkBegin = text.rfind("|H");
|
size_t lastLinkBegin = text.rfind("|H");
|
||||||
uint32 lastLinkEnd = text.find("|h|r", lastLinkBegin + 1);
|
size_t lastLinkEnd = text.find("|h|r", lastLinkBegin + 1);
|
||||||
if (pos >= lastLinkBegin && pos <= lastLinkEnd)
|
if (pos >= lastLinkBegin && pos <= lastLinkEnd)
|
||||||
pos = text.find_last_of(sep, lastLinkBegin);
|
pos = text.find_last_of(sep, lastLinkBegin);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user