Core/Instances: use the map expansion id to determine the needed level to award guild challenges and be worthy of guild news

This commit is contained in:
Ovahlord
2021-04-29 17:02:55 +02:00
parent 0b51addde9
commit 2af716c0d4

View File

@@ -789,17 +789,14 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi
}
// Reward eligible guild challenges
LFGDungeonEntry const* entry = sLFGDungeonStore.LookupEntry(dungeonId);
if (!entry)
return;
uint8 appropriateMaxLevel = DBCManager::GetMaxLevelForExpansion(sMapStore.AssertEntry(instance->GetId())->Expansion());
for (auto itr : minlevelByGuild)
{
Guild* guild = sGuildMgr->GetGuildById(itr.first);
if (!guild)
continue;
if (itr.second <= entry->Maxlevel)
if (itr.second <= appropriateMaxLevel)
{
if (Player* player = playersByGuild[itr.first])
{