Core/Common: Tokenizer -> Trinity::Tokenize
This commit is contained in:
1 parent
95329dc15c
commit
f95a8bfdca
32 files changed
+414
-354
No files matched your search
@@ -45,6 +45,7 @@
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellDefines.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "StringConvert.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Totem.h"
|
||||
#include "Transport.h"
|
||||
@@ -783,21 +784,25 @@ uint32 Object::GetUpdateFieldData(Player const* target, uint32*& flags) const
|
||||
return visibleFlag;
|
||||
}
|
||||
|
||||
void Object::_LoadIntoDataField(std::string const& data, uint32 startOffset, uint32 count)
|
||||
bool Object::_LoadIntoDataField(std::string const& data, uint32 startOffset, uint32 count)
|
||||
{
|
||||
if (data.empty())
|
||||
return;
|
||||
return false;
|
||||
|
||||
Tokenizer tokens(data, ' ', count);
|
||||
std::vector<std::string_view> tokens = Trinity::Tokenize(data, ' ', false);
|
||||
|
||||
if (tokens.size() != count)
|
||||
return;
|
||||
return false;
|
||||
|
||||
for (uint32 index = 0; index < count; ++index)
|
||||
{
|
||||
m_uint32Values[startOffset + index] = atoul(tokens[index]);
|
||||
Optional<uint32> val = Trinity::StringTo<uint32>(tokens[index]);
|
||||
if (!val)
|
||||
return false;
|
||||
m_uint32Values[startOffset + index] = *val;
|
||||
_changesMask.SetBit(startOffset + index);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Object::SetInt32Value(uint16 index, int32 value)
|
||||
|
||||
Reference in new issue
Block a user