From 181e6a1b9de01dd6782af35d91277294e1364f6b Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Fri, 21 Jul 2023 18:53:59 -0300 Subject: [PATCH 1/2] fix: Improve on the check --- src/mod-double-xp-weekend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod-double-xp-weekend.cpp b/src/mod-double-xp-weekend.cpp index 3863299..9e9a4c1 100644 --- a/src/mod-double-xp-weekend.cpp +++ b/src/mod-double-xp-weekend.cpp @@ -79,14 +79,14 @@ class DoubleXpWeekend : public PlayerScript } - void OnGiveXP(Player* player, uint32& amount, Unit* victim, uint8 /*xpSource*/) override + void OnGiveXP(Player* player, uint32& amount, Unit* victim, uint8 xpSource) override { if (!IsEventActive()) { return; } - if (sConfigMgr->GetOption("XPWeekend.QuestOnly", false) && victim && victim->GetTypeId() == TYPEID_UNIT && !victim->ToCreature()->hasLootRecipient()) + if (sConfigMgr->GetOption("XPWeekend.QuestOnly", false) && xpSource != PlayerXPSource::XPSOURCE_QUEST) { return; } From 7d35c8c222fb74bed0d479689b091016dd160eee Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Fri, 21 Jul 2023 18:54:47 -0300 Subject: [PATCH 2/2] Update mod-double-xp-weekend.cpp --- src/mod-double-xp-weekend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod-double-xp-weekend.cpp b/src/mod-double-xp-weekend.cpp index 4c4b884..9e9a4c1 100644 --- a/src/mod-double-xp-weekend.cpp +++ b/src/mod-double-xp-weekend.cpp @@ -85,7 +85,7 @@ class DoubleXpWeekend : public PlayerScript { return; } - + if (sConfigMgr->GetOption("XPWeekend.QuestOnly", false) && xpSource != PlayerXPSource::XPSOURCE_QUEST) { return;