Core/Misc: Reduce differences between branches

This commit is contained in:
Shauren
2025-09-28 00:06:28 +02:00
parent eac8411fe6
commit 13f22e0c06
9 changed files with 16 additions and 21 deletions

View File

@@ -187,7 +187,7 @@ LFGDungeonData const* LFGMgr::GetLFGDungeon(uint32 id)
return nullptr;
}
void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
void LFGMgr::LoadLFGDungeons()
{
uint32 oldMSTime = getMSTime();
@@ -231,7 +231,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
LFGDungeonContainer::iterator dungeonItr = LfgDungeonStore.find(dungeonId);
if (dungeonItr == LfgDungeonStore.end())
{
TC_LOG_ERROR("sql.sql", "table `lfg_entrances` contains coordinates for wrong dungeon {}", dungeonId);
TC_LOG_ERROR("sql.sql", "table `lfg_dungeon_template` contains coordinates for wrong dungeon {}", dungeonId);
continue;
}
@@ -248,6 +248,8 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
TC_LOG_INFO("server.loading", ">> Loaded {} lfg dungeon templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
CachedDungeonMapStore.clear();
// Fill all other teleport coords from areatriggers
for (LFGDungeonContainer::iterator itr = LfgDungeonStore.begin(); itr != LfgDungeonStore.end(); ++itr)
{
@@ -274,9 +276,6 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
CachedDungeonMapStore[dungeon.group].insert(dungeon.id);
CachedDungeonMapStore[0].insert(dungeon.id);
}
if (reload)
CachedDungeonMapStore.clear();
}
LFGMgr* LFGMgr::instance()

View File

@@ -339,7 +339,7 @@ class TC_GAME_API LFGMgr
/// Loads rewards for random dungeons
void LoadRewards();
/// Loads dungeons from dbc and adds teleport coords
void LoadLFGDungeons(bool reload = false);
void LoadLFGDungeons();
// Multiple files
/// Check if given guid applied for random dungeon

View File

@@ -1421,12 +1421,10 @@ bool Item::HasEnchantRequiredSkill(Player const* player) const
{
// Check all enchants for required skill
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->RequiredSkillID && player->GetSkillValue(enchantEntry->RequiredSkillID) < enchantEntry->RequiredSkillRank)
return false;
}
return true;
}

View File

@@ -2316,7 +2316,7 @@ void Player::GiveLevel(uint8 level)
UpdateAllStats();
_ApplyAllLevelScaleItemMods(true); // Moved to above SetFullHealth so player will have full health from Heirlooms
_ApplyAllLevelScaleItemMods(true);
if (Aura const* artifactAura = GetAura(ARTIFACTS_ALL_WEAPONS_GENERAL_WEAPON_EQUIPPED_PASSIVE))
if (Item* artifact = GetItemByGuid(artifactAura->GetCastItemGUID()))
@@ -25983,7 +25983,7 @@ bool Player::isHonorOrXPTarget(Unit const* victim) const
if (v_level < k_grey && !sWorld->getIntConfig(CONFIG_MIN_CREATURE_SCALED_XP_RATIO))
return false;
if (Creature const* const creature = victim->ToCreature())
if (Creature const* creature = victim->ToCreature())
{
if (creature->IsCritter() || creature->IsTotem())
return false;

View File

@@ -6089,6 +6089,7 @@ void ObjectMgr::LoadSpellScriptNames()
TC_LOG_ERROR("sql.sql", "Scriptname: `{}` spell (Id: {}) is not first rank of spell.", scriptName, fields[0].GetInt32());
continue;
}
while (spellInfo)
{
_spellScriptsStore.insert(SpellScriptsContainer::value_type(spellInfo->Id, std::make_pair(GetScriptId(scriptName), true)));

View File

@@ -589,8 +589,11 @@ void WorldSession::HandleGuildReplaceGuildMaster(WorldPackets::Guild::GuildRepla
void WorldSession::HandleGuildSetGuildMaster(WorldPackets::Guild::GuildSetGuildMaster& packet)
{
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleSetNewGuildMaster(this, packet.NewMasterName, false);
TC_LOG_DEBUG("guild", "CMSG_GUILD_SET_GUILD_MASTER [{}]: Target: {}", GetPlayerInfo(), packet.NewMasterName);
if (normalizePlayerName(packet.NewMasterName))
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleSetNewGuildMaster(this, packet.NewMasterName, false);
}
void WorldSession::HandleGuildSetAchievementTracking(WorldPackets::Guild::GuildSetAchievementTracking& packet)

View File

@@ -236,11 +236,6 @@ void LootStore::ReportUnusedIds(LootIdSet const& lootIdSet) const
TC_LOG_ERROR("sql.sql", "Table '{}' Entry {} isn't {} and not referenced from loot, and thus useless.", GetName(), lootId, GetEntryName());
}
void LootStore::ReportNonExistingId(uint32 lootId) const
{
TC_LOG_ERROR("sql.sql", "Table '{}' Entry {} does not exist", GetName(), lootId);
}
void LootStore::ReportNonExistingId(uint32 lootId, char const* ownerType, uint32 ownerId) const
{
TC_LOG_ERROR("sql.sql", "Table '{}' Entry {} does not exist but it is used by {} {}", GetName(), lootId, ownerType, ownerId);
@@ -1127,7 +1122,7 @@ void LoadLootTemplates_Disenchant()
{
uint32 lootid = disenchant->ID;
if (!lootIdSet.contains(lootid))
LootTemplates_Disenchant.ReportNonExistingId(lootid);
LootTemplates_Disenchant.ReportNonExistingId(lootid, "ItemDisenchantLoot", lootid);
else
lootIdSetUsed.insert(lootid);
}
@@ -1139,7 +1134,7 @@ void LoadLootTemplates_Disenchant()
uint32 lootid = itemBonus->Value[0];
if (!lootIdSet.contains(lootid))
LootTemplates_Disenchant.ReportNonExistingId(lootid);
LootTemplates_Disenchant.ReportNonExistingId(lootid, "ItemBonusList", itemBonus->ParentItemBonusListID);
else
lootIdSetUsed.insert(lootid);
}

View File

@@ -87,7 +87,6 @@ class TC_GAME_API LootStore
uint32 LoadAndCollectLootIds(LootIdSet& lootIdSet);
void CheckLootRefs(LootIdSet* ref_set = nullptr) const; // check existence reference and remove it from ref_set
void ReportUnusedIds(LootIdSet const& lootIdSet) const;
void ReportNonExistingId(uint32 lootId) const;
void ReportNonExistingId(uint32 lootId, char const* ownerType, uint32 ownerId) const;
bool HaveLootFor(uint32 loot_id) const { return m_LootTemplates.contains(loot_id); }

View File

@@ -209,7 +209,7 @@ std::string ReputationMgr::GetReputationRankName(FactionEntry const* factionEntr
{
ReputationRank rank = GetRank(factionEntry);
if (!factionEntry->FriendshipRepID)
return sObjectMgr->GetTrinityString(ReputationRankStrIndex[GetRank(factionEntry)], _player->GetSession()->GetSessionDbcLocale());
return sObjectMgr->GetTrinityString(ReputationRankStrIndex[rank], _player->GetSession()->GetSessionDbcLocale());
if (DB2Manager::FriendshipRepReactionSet const* friendshipReactions = sDB2Manager.GetFriendshipRepReactions(factionEntry->FriendshipRepID))
{