aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorPeter Keresztes Schmidt <carbenium@outlook.com>2020-07-12 15:36:55 +0200
committerShauren <shauren.trinity@gmail.com>2022-01-23 00:06:16 +0100
commit1e1679a1f7d9cdecb49f40f8084b46dbfd48577b (patch)
treeef2e1aa948151f2efb2c8a999e9a71a6d4f17a4d /src/server/game
parentb7353fb92795801c2c2a52035026e9e0059fa83d (diff)
Core/DataStores: Port refactors from Update DBC field names to generated ones (#24999)
(cherry picked from commit c92950b3e1f6366d85d707365a8ad2caddafeecc)
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/Chat/Channels/Channel.cpp6
-rw-r--r--src/server/game/Chat/Hyperlinks.cpp8
-rw-r--r--src/server/game/Entities/Item/Item.cpp2
-rw-r--r--src/server/game/Entities/Object/Object.cpp8
-rw-r--r--src/server/game/Entities/Player/Player.cpp6
-rw-r--r--src/server/game/Groups/Group.cpp2
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp12
-rw-r--r--src/server/game/Handlers/ItemHandler.cpp2
-rw-r--r--src/server/game/Handlers/NPCHandler.cpp4
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h2
-rw-r--r--src/server/game/Quests/QuestDef.cpp2
11 files changed, 26 insertions, 28 deletions
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index baea34a3108..7f5a6cc8aec 100644
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -48,13 +48,13 @@ Channel::Channel(ObjectGuid const& guid, uint32 channelId, uint32 team /*= 0*/,
_zoneEntry(zoneEntry)
{
ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId);
- if (channelEntry->Flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
+ if (channelEntry->Flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
_channelFlags |= CHANNEL_FLAG_TRADE;
- if (channelEntry->Flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
+ if (channelEntry->Flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
_channelFlags |= CHANNEL_FLAG_CITY;
- if (channelEntry->Flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
+ if (channelEntry->Flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
_channelFlags |= CHANNEL_FLAG_LFG;
else // for all other channels
_channelFlags |= CHANNEL_FLAG_NOT_LFG;
diff --git a/src/server/game/Chat/Hyperlinks.cpp b/src/server/game/Chat/Hyperlinks.cpp
index 3b2f67bb832..88a4dcfae2b 100644
--- a/src/server/game/Chat/Hyperlinks.cpp
+++ b/src/server/game/Chat/Hyperlinks.cpp
@@ -495,9 +495,9 @@ struct LinkValidator<LinkTags::outfit>
template <>
struct LinkValidator<LinkTags::pvptal>
{
- static bool IsTextValid(PvpTalentEntry const* mawPower, char const* pos, size_t len)
+ static bool IsTextValid(PvpTalentEntry const* pvpTalent, char const* pos, size_t len)
{
- if (SpellInfo const* info = sSpellMgr->GetSpellInfo(mawPower->SpellID, DIFFICULTY_NONE))
+ if (SpellInfo const* info = sSpellMgr->GetSpellInfo(pvpTalent->SpellID, DIFFICULTY_NONE))
return LinkValidator<LinkTags::spell>::IsTextValid(info, pos, len);
return false;
}
@@ -511,9 +511,9 @@ struct LinkValidator<LinkTags::pvptal>
template <>
struct LinkValidator<LinkTags::talent>
{
- static bool IsTextValid(TalentEntry const* mawPower, char const* pos, size_t len)
+ static bool IsTextValid(TalentEntry const* talent, char const* pos, size_t len)
{
- if (SpellInfo const* info = sSpellMgr->GetSpellInfo(mawPower->SpellID, DIFFICULTY_NONE))
+ if (SpellInfo const* info = sSpellMgr->GetSpellInfo(talent->SpellID, DIFFICULTY_NONE))
return LinkValidator<LinkTags::spell>::IsTextValid(info, pos, len);
return false;
}
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 7d4d7f271b2..683114e3f80 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -1295,12 +1295,10 @@ uint32 Item::GetEnchantRequiredLevel() const
// Check all enchants for required level
for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
- {
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
if (enchantEntry->MinLevel > level)
level = enchantEntry->MinLevel;
- }
return level;
}
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 9c17f1805c6..d8a4b65f6ea 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -2529,8 +2529,8 @@ ReputationRank WorldObject::GetReactionTo(WorldObject const* target) const
if (targetFactionEntry->CanHaveReputation())
{
// check contested flags
- if (targetFactionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
- && selfPlayerOwner->HasPlayerFlag(PLAYER_FLAGS_CONTESTED_PVP))
+ if ((targetFactionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) &&
+ selfPlayerOwner->HasPlayerFlag(PLAYER_FLAGS_CONTESTED_PVP))
return REP_HOSTILE;
// if faction has reputation, hostile state depends only from AtWar state
@@ -2562,8 +2562,8 @@ ReputationRank WorldObject::GetReactionTo(WorldObject const* target) const
if (Player const* targetPlayerOwner = target->GetAffectingPlayer())
{
// check contested flags
- if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
- && targetPlayerOwner->HasPlayerFlag(PLAYER_FLAGS_CONTESTED_PVP))
+ if ((factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) &&
+ targetPlayerOwner->HasPlayerFlag(PLAYER_FLAGS_CONTESTED_PVP))
return REP_HOSTILE;
if (ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry))
return *repRank;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index bdc8b61858b..05a04187978 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -6570,7 +6570,7 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto
// [39+] Nothing
// this is all wrong, should be going off PvpTitle, not PlayerTitle
uint32 victim_title = plrVictim->m_playerData->PlayerTitle;
- // Get Killer titles, CharTitlesEntry::bit_index
+ // Get Killer titles, CharTitlesEntry::MaskID
// Ranks:
// title[1..14] -> rank[5..18]
// title[15..28] -> rank[5..18]
@@ -8392,7 +8392,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
if (!spellInfo)
{
TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell: Player '%s' (%s) cast unknown spell (EnchantID: %u, SpellID: %i), ignoring",
- GetName().c_str(), GetGUID().ToString().c_str(), enchant_id, pEnchant->EffectArg[s]);
+ GetName().c_str(), GetGUID().ToString().c_str(), pEnchant->ID, pEnchant->EffectArg[s]);
continue;
}
@@ -8493,7 +8493,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, Objec
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectArg[s], DIFFICULTY_NONE);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", enchant_id, pEnchant->EffectArg[s]);
+ TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->EffectArg[s]);
continue;
}
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index d9d8d8fd425..037a5b546ca 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1876,7 +1876,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
// check for min / max count
uint32 memberscount = GetMembersCount();
- if (int32(memberscount) > bgEntry->MaxGroupSize) // no MinPlayerCount for battlegrounds
+ if (int32(memberscount) > bgEntry->MaxGroupSize) // no MinPlayerCount for battlegrounds
return ERR_BATTLEGROUND_NONE; // ERR_GROUP_JOIN_BATTLEGROUND_TOO_MANY handled on client side
// get a player as reference, to compare other players' stats to (arena team id, queue id based on level, etc.)
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index b6970b5f6e9..fb612057e94 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -2486,12 +2486,12 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptr<WorldPa
// new team
if (newTeamId == TEAM_ALLIANCE)
{
- uint32 maskID = htitleInfo->MaskID;
- uint32 index = maskID / 32;
+ uint32 bitIndex = htitleInfo->MaskID;
+ uint32 index = bitIndex / 32;
if (index >= knownTitles.size())
continue;
- uint32 old_flag = 1 << (maskID % 32);
+ uint32 old_flag = 1 << (bitIndex % 32);
uint32 new_flag = 1 << (atitleInfo->MaskID % 32);
if (knownTitles[index] & old_flag)
{
@@ -2502,12 +2502,12 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptr<WorldPa
}
else
{
- uint32 maskID = atitleInfo->MaskID;
- uint32 index = maskID / 32;
+ uint32 bitIndex = htitleInfo->MaskID;
+ uint32 index = bitIndex / 32;
if (index >= knownTitles.size())
continue;
- uint32 old_flag = 1 << (maskID % 32);
+ uint32 old_flag = 1 << (bitIndex % 32);
uint32 new_flag = 1 << (htitleInfo->MaskID % 32);
if (knownTitles[index] & old_flag)
{
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index c148f4b4a81..7f6fcdb73ed 100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -1037,7 +1037,7 @@ void WorldSession::HandleSocketGems(WorldPackets::Item::SocketGems& socketGems)
{
if (ItemLimitCategoryEntry const* limitEntry = sItemLimitCategoryStore.LookupEntry(iGemProto->GetItemLimitCategory()))
{
- // NOTE: limitEntry->mode is not checked because if item has limit then it is applied in equip case
+ // NOTE: limitEntry->Flags is not checked because if item has limit then it is applied in equip case
for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
{
if (gems[j])
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp
index cd4956f3df7..ae0bf737365 100644
--- a/src/server/game/Handlers/NPCHandler.cpp
+++ b/src/server/game/Handlers/NPCHandler.cpp
@@ -602,10 +602,10 @@ void WorldSession::HandleBuyStableSlot(WorldPacket& recvData)
if (GetPlayer()->m_stableSlots < MAX_PET_STABLES)
{
/*StableSlotPricesEntry const* SlotPrice = sStableSlotPricesStore.LookupEntry(GetPlayer()->m_stableSlots+1);
- if (_player->HasEnoughMoney(SlotPrice->Price))
+ if (_player->HasEnoughMoney(SlotPrice->Cost))
{
++GetPlayer()->m_stableSlots;
- _player->ModifyMoney(-int32(SlotPrice->Price));
+ _player->ModifyMoney(-int32(SlotPrice->Cost));
SendPetStableResult(StableResult::BuySlotSuccess);
}
else
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 585a8a252d1..56cb37b085b 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -5740,7 +5740,7 @@ enum ChatLinkColors : uint32
CHAT_LINK_COLOR_TRANSMOG = 0xffff80ff,
};
-// Values from ItemPetFood (power of (value-1) used for compare with CreatureFamilyEntry.petDietMask
+// Values from ItemPetFood (power of (value-1) used for compare with CreatureFamilyEntry.PetFoodMask
enum PetDiet
{
PET_DIET_MEAT = 1,
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index 519c5873f6c..fd4d505655b 100644
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -460,7 +460,7 @@ uint32 Quest::CalculateHonorGain(uint8 /*level*/) const
if (!tc)
return 0;
- honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1f);
+ honor = uint32(tc->Data * GetRewHonorMultiplier() * 0.1f);
honor += GetRewHonorAddition();
}*/