mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-14 16:03:45 +00:00
refactor(Core/Instances): Implement GetTeamIdInInstance() for two-fac… (#21168)
This commit is contained in:
@@ -141,7 +141,7 @@ typedef std::map<ObjectGuid::LowType /*spawnId*/, uint8 /*state*/> ObjectStateMa
|
||||
class InstanceScript : public ZoneScript
|
||||
{
|
||||
public:
|
||||
explicit InstanceScript(Map* map) : instance(map), completedEncounters(0) {}
|
||||
explicit InstanceScript(Map* map) : instance(map), completedEncounters(0), _teamIdInInstance(TEAM_NEUTRAL) {}
|
||||
|
||||
~InstanceScript() override {}
|
||||
|
||||
@@ -182,10 +182,10 @@ public:
|
||||
GameObject* GetGameObject(uint32 type);
|
||||
|
||||
//Called when a player successfully enters the instance.
|
||||
virtual void OnPlayerEnter(Player* /*player*/) {}
|
||||
virtual void OnPlayerEnter(Player* /*player*/);
|
||||
|
||||
//Called when a player successfully leaves the instance.
|
||||
virtual void OnPlayerLeave(Player* /*player*/) {}
|
||||
virtual void OnPlayerLeave(Player* /*player*/);
|
||||
|
||||
virtual void OnPlayerAreaUpdate(Player* /*player*/, uint32 /*oldArea*/, uint32 /*newArea*/) {}
|
||||
|
||||
@@ -322,6 +322,9 @@ protected:
|
||||
void WritePersistentData(std::ostringstream& data);
|
||||
virtual void WriteSaveDataMore(std::ostringstream& /*data*/) { }
|
||||
|
||||
TeamId GetTeamIdInInstance() const { return _teamIdInInstance; }
|
||||
bool IsTwoFactionInstance() const;
|
||||
|
||||
private:
|
||||
static void LoadObjectData(ObjectData const* creatureData, ObjectInfoMap& objectInfo);
|
||||
|
||||
@@ -336,6 +339,7 @@ private:
|
||||
ObjectGuidMap _objectGuids;
|
||||
ObjectStateMap _objectStateMap;
|
||||
uint32 completedEncounters; // completed encounter mask, bit indexes are DungeonEncounter.dbc boss numbers, used for packets
|
||||
TeamId _teamIdInInstance;
|
||||
std::unordered_set<uint32> _activatedAreaTriggers;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user