Core/Misc: reduced amount of string memory allocations (Step II)
This commit is contained in:
1 parent
013fb1f4d9
commit
9fbc4c0ae2
35 files changed
+160
-163
No files matched your search
@@ -190,16 +190,14 @@ void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint8 level
|
||||
SetTaximaskNode(213); //Shattered Sun Staging Area
|
||||
}
|
||||
|
||||
void PlayerTaxi::LoadTaxiMask(const char* data)
|
||||
void PlayerTaxi::LoadTaxiMask(std::string const &data)
|
||||
{
|
||||
Tokenizer tokens(data, ' ');
|
||||
|
||||
uint8 index;
|
||||
Tokenizer::const_iterator iter;
|
||||
for (iter = tokens.begin(), index = 0;
|
||||
(index < TaxiMaskSize) && (iter != tokens.end()); ++iter, ++index)
|
||||
uint8 index = 0;
|
||||
for (Tokenizer::const_iterator iter = tokens.begin(); index < TaxiMaskSize && iter != tokens.end(); ++iter, ++index)
|
||||
{
|
||||
// load and set bits only for existed taxi nodes
|
||||
// load and set bits only for existing taxi nodes
|
||||
m_taximask[index] = sTaxiNodesMask[index] & uint32(atol(*iter));
|
||||
}
|
||||
}
|
||||
@@ -17062,7 +17060,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
m_resetTalentsCost = fields[24].GetUInt32();
|
||||
m_resetTalentsTime = time_t(fields[25].GetUInt32());
|
||||
|
||||
m_taxi.LoadTaxiMask(fields[17].GetCString()); // must be before InitTaxiNodesForLevel
|
||||
m_taxi.LoadTaxiMask(fields[17].GetString()); // must be before InitTaxiNodesForLevel
|
||||
|
||||
uint32 extraflags = fields[31].GetUInt16();
|
||||
|
||||
|
||||
Reference in new issue
Block a user