mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
feat(Core/Common): delete old Tokenizer (#10121)
This commit is contained in:
@@ -48,6 +48,8 @@
|
||||
#include "Vehicle.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "Tokenize.h"
|
||||
#include "StringConvert.h"
|
||||
|
||||
// TODO: this import is not necessary for compilation and marked as unused by the IDE
|
||||
// however, for some reasons removing it would cause a damn linking issue
|
||||
@@ -610,21 +612,29 @@ 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 = Acore::Tokenize(data, ' ', false);
|
||||
|
||||
if (tokens.size() != count)
|
||||
return;
|
||||
return false;
|
||||
|
||||
for (uint32 index = 0; index < count; ++index)
|
||||
{
|
||||
m_uint32Values[startOffset + index] = atol(tokens[index]);
|
||||
Optional<uint32> val = Acore::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