Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-08-01 15:41:23 +08:00
251 changed files with 4841 additions and 6135 deletions

View File

@@ -434,7 +434,7 @@ Player::~Player()
delete PlayerTalkClass;
for (size_t x = 0; x < ItemSetEff.size(); x++)
for (std::size_t x = 0; x < ItemSetEff.size(); x++)
delete ItemSetEff[x];
delete m_declinedname;
@@ -2749,7 +2749,7 @@ void Player::SendInitialSpells()
WorldPacket data(SMSG_INITIAL_SPELLS, (1 + 2 + 4 * m_spells.size() + 2 + m_spellCooldowns.size() * (4 + 2 + 2 + 4 + 4)));
data << uint8(0);
size_t countPos = data.wpos();
std::size_t countPos = data.wpos();
data << uint16(spellCount); // spell count placeholder
for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
@@ -8164,7 +8164,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
data << uint32(mapid); // mapid
data << uint32(zoneid); // zone id
data << uint32(areaid); // area id, new 2.1.0
size_t countPos = data.wpos();
std::size_t countPos = data.wpos();
data << uint16(0); // count of uint64 blocks
data << uint32(0x8d8) << uint32(0x0); // 1
data << uint32(0x8d7) << uint32(0x0); // 2
@@ -9453,7 +9453,7 @@ void Player::PetSpellInitialize()
// action bar loop
charmInfo->BuildActionBar(&data);
size_t spellsCountPos = data.wpos();
std::size_t spellsCountPos = data.wpos();
// spells count
uint8 addlist = 0;
@@ -14281,7 +14281,7 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data)
for (uint32 specIdx = 0; specIdx < m_specsCount; ++specIdx)
{
uint8 talentIdCount = 0;
size_t pos = data->wpos();
std::size_t pos = data->wpos();
*data << uint8(talentIdCount); // [PH], talentIdCount
const PlayerTalentMap& talentMap = GetTalentMap();
@@ -14306,11 +14306,11 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data)
void Player::BuildPetTalentsInfoData(WorldPacket* data)
{
uint32 unspentTalentPoints = 0;
size_t pointsPos = data->wpos();
std::size_t pointsPos = data->wpos();
*data << uint32(unspentTalentPoints); // [PH], unspentTalentPoints
uint8 talentIdCount = 0;
size_t countPos = data->wpos();
std::size_t countPos = data->wpos();
*data << uint8(talentIdCount); // [PH], talentIdCount
Pet* pet = GetPet();
@@ -14389,7 +14389,7 @@ void Player::SendTalentsInfoData(bool pet)
void Player::BuildEnchantmentsInfoData(WorldPacket* data)
{
uint32 slotUsedMask = 0;
size_t slotUsedMaskPos = data->wpos();
std::size_t slotUsedMaskPos = data->wpos();
*data << uint32(slotUsedMask); // slotUsedMask < 0x80000
for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
@@ -14404,7 +14404,7 @@ void Player::BuildEnchantmentsInfoData(WorldPacket* data)
*data << uint32(item->GetEntry()); // item entry
uint16 enchantmentMask = 0;
size_t enchantmentMaskPos = data->wpos();
std::size_t enchantmentMaskPos = data->wpos();
*data << uint16(enchantmentMask); // enchantmentMask < 0x1000
for (uint32 j = 0; j < MAX_ENCHANTMENT_SLOT; ++j)
@@ -14433,7 +14433,7 @@ void Player::SendEquipmentSetList()
{
uint32 count = 0;
WorldPacket data(SMSG_EQUIPMENT_SET_LIST, 4);
size_t count_pos = data.wpos();
std::size_t count_pos = data.wpos();
data << uint32(count); // count placeholder
for (EquipmentSets::iterator itr = m_EquipmentSets.begin(); itr != m_EquipmentSets.end(); ++itr)
{

View File

@@ -1599,7 +1599,7 @@ public:
QuestStatusMap& getQuestStatusMap() { return m_QuestStatus; }
QuestStatusSaveMap& GetQuestStatusSaveMap() { return m_QuestStatusSave; }
[[nodiscard]] size_t GetRewardedQuestCount() const { return m_RewardedQuests.size(); }
[[nodiscard]] std::size_t GetRewardedQuestCount() const { return m_RewardedQuests.size(); }
[[nodiscard]] bool IsQuestRewarded(uint32 quest_id) const
{
return m_RewardedQuests.find(quest_id) != m_RewardedQuests.end();

View File

@@ -6537,7 +6537,7 @@ void Player::SendRaidInfo()
WorldPacket data(SMSG_RAID_INSTANCE_INFO, 4);
size_t p_counter = data.wpos();
std::size_t p_counter = data.wpos();
data << uint32(counter); // placeholder
time_t now = GameTime::GetGameTime().count();
@@ -7318,7 +7318,7 @@ void Player::_SaveInventory(CharacterDatabaseTransaction trans)
return;
ObjectGuid::LowType lowGuid = GetGUID().GetCounter();
for (size_t i = 0; i < m_itemUpdateQueue.size(); ++i)
for (std::size_t i = 0; i < m_itemUpdateQueue.size(); ++i)
{
Item* item = m_itemUpdateQueue[i];
if (!item)

View File

@@ -170,7 +170,7 @@ bool PlayerTaxi::LoadTaxiDestinationsFromString(const std::string& values, TeamI
return false;
}
for (size_t i = 1; i < m_TaxiDestinations.size(); ++i)
for (std::size_t i = 1; i < m_TaxiDestinations.size(); ++i)
{
uint32 cost;
uint32 path;
@@ -202,7 +202,7 @@ std::string PlayerTaxi::SaveTaxiDestinationsToString()
std::ostringstream ss;
ss << m_flightMasterFactionId << ' ';
for (size_t i = 0; i < m_TaxiDestinations.size(); ++i)
for (std::size_t i = 0; i < m_TaxiDestinations.size(); ++i)
{
ss << m_TaxiDestinations[i] << ' ';
}

View File

@@ -865,7 +865,7 @@ bool Player::UpdateFishingSkill()
// bonus abilities in sSkillLineAbilityStore
// Used only to avoid scan DBC at each skill grow
static uint32 bonusSkillLevels[] = {75, 150, 225, 300, 375, 450};
static const size_t bonusSkillLevelsSize =
static const std::size_t bonusSkillLevelsSize =
sizeof(bonusSkillLevels) / sizeof(uint32);
bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
@@ -909,7 +909,7 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
if (itr->second.uState != SKILL_NEW)
itr->second.uState = SKILL_CHANGED;
for (size_t i = 0; i < bonusSkillLevelsSize; ++i)
for (std::size_t i = 0; i < bonusSkillLevelsSize; ++i)
{
uint32 bsl = bonusSkillLevels[i];
if (SkillValue < bsl && new_value >= bsl)
@@ -1323,7 +1323,7 @@ void Player::UpdateEquipSpellsAtFormChange()
}
// item set bonuses not dependent from item broken state
for (size_t setindex = 0; setindex < ItemSetEff.size(); ++setindex)
for (std::size_t setindex = 0; setindex < ItemSetEff.size(); ++setindex)
{
ItemSetEffect* eff = ItemSetEff[setindex];
if (!eff)

View File

@@ -132,7 +132,7 @@ void PlayerSocial::SendSocialList(Player* player, uint32 flags)
WorldPacket data(SMSG_CONTACT_LIST, (4 + 4 + m_playerSocialMap.size() * 25)); // just can guess size
data << uint32(flags); // 0x1 = Friendlist update. 0x2 = Ignorelist update. 0x4 = Mutelist update.
size_t countPos = data.wpos();
std::size_t countPos = data.wpos();
data << uint32(0); // contacts count placeholder
for (auto& itr : m_playerSocialMap)