From 145cbb0cceb918eb84997251b105d9a758f22a47 Mon Sep 17 00:00:00 2001 From: Jarrod Ingram Date: Fri, 13 Jan 2023 14:07:12 +1100 Subject: [PATCH] Fix starting progression and dungeon teleports --- src/IndividualProgression.cpp | 2 +- src/IndividualProgression.h | 1 + src/IndividualProgressionPlayer.cpp | 13 +++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/IndividualProgression.cpp b/src/IndividualProgression.cpp index 40c2ab2..0755065 100644 --- a/src/IndividualProgression.cpp +++ b/src/IndividualProgression.cpp @@ -25,7 +25,7 @@ bool IndividualProgression::isBeforeProgression(Player* player, ProgressionState void IndividualProgression::UpdateProgressionState(Player* player, ProgressionState newState) const { - if (progressionLimit && newState >= progressionLimit) + if (progressionLimit && newState > progressionLimit) return; uint8 currentState = player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value; if (newState > currentState) diff --git a/src/IndividualProgression.h b/src/IndividualProgression.h index 5370573..161fe4e 100644 --- a/src/IndividualProgression.h +++ b/src/IndividualProgression.h @@ -9,6 +9,7 @@ #include "GameObjectAI.h" #include "MapMgr.h" #include "ObjectAccessor.h" +#include "ObjectMgr.h" #include "Group.h" #include "Pet.h" #include "DBCEnums.h" diff --git a/src/IndividualProgressionPlayer.cpp b/src/IndividualProgressionPlayer.cpp index f1de350..06e35e5 100644 --- a/src/IndividualProgressionPlayer.cpp +++ b/src/IndividualProgressionPlayer.cpp @@ -202,6 +202,19 @@ public: { return false; } + + InstanceTemplate const* instanceTemplate = sObjectMgr->GetInstanceTemplate(mapid); + if (instanceTemplate) + { + if (instanceTemplate->Parent == MAP_OUTLANDS && !sIndividualProgression->hasPassedProgression(player, PROGRESSION_NAXX40)) + { + return false; + } + if (instanceTemplate->Parent == MAP_NORTHREND && !sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_5)) + { + return false; + } + } return true; }