Core/Players: Added helper function to check quest completion using QuestV2 bits

Port From (https://github.com/TrinityCore/TrinityCore/commit/d78c3bb33afeb319ef0cf09171aabd8952a928fa)
This commit is contained in:
Hondacrx
2025-05-19 15:26:49 -04:00
parent 4a29928f13
commit 4f63e81373
3 changed files with 18 additions and 10 deletions
+2 -4
View File
@@ -1848,10 +1848,8 @@ namespace Game.Achievements
break;
}
case ModifierTreeType.PlayerHasCompletedQuest: // 110
uint questBit = Global.DB2Mgr.GetQuestUniqueBitFlag(reqValue);
if (questBit != 0)
if ((referencePlayer.m_activePlayerData.QuestCompleted[((int)questBit - 1) >> 6] & (1ul << (((int)questBit - 1) & 63))) == 0)
return false;
if (!referencePlayer.IsQuestCompletedBitSet(reqValue))
return false;
break;
case ModifierTreeType.PlayerIsReadyToTurnInQuest: // 111
if (referencePlayer.GetQuestStatus(reqValue) != QuestStatus.Complete)