mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
refactor(Core/GameObject): Move the GameObject state save handling to… (#18080)
* refactor(Core/GameObject): Move the GameObject state save handling to instance level * Update GameObject.h * remove leftover * small improvements
This commit is contained in:
@@ -136,6 +136,7 @@ typedef std::pair<DoorInfoMap::const_iterator, DoorInfoMap::const_iterator> Door
|
||||
typedef std::map<uint32 /*entry*/, MinionInfo> MinionInfoMap;
|
||||
typedef std::map<uint32 /*type*/, ObjectGuid /*guid*/> ObjectGuidMap;
|
||||
typedef std::map<uint32 /*entry*/, uint32 /*type*/> ObjectInfoMap;
|
||||
typedef std::map<ObjectGuid::LowType /*spawnId*/, uint8 /*state*/> ObjectStateMap;
|
||||
|
||||
class InstanceScript : public ZoneScript
|
||||
{
|
||||
@@ -265,6 +266,12 @@ public:
|
||||
// Allows executing code using all creatures registered in the instance script as minions
|
||||
void DoForAllMinions(uint32 id, std::function<void(Creature*)> exec);
|
||||
|
||||
//
|
||||
void StoreGameObjectState(ObjectGuid::LowType spawnId, uint8 state) { _objectStateMap[spawnId] = state; };
|
||||
[[nodiscard]] uint8 GetStoredGameObjectState(ObjectGuid::LowType spawnId) const;
|
||||
|
||||
void LoadInstanceSavedGameobjectStateData();
|
||||
|
||||
TaskScheduler scheduler;
|
||||
protected:
|
||||
void SetHeaders(std::string const& dataHeaders);
|
||||
@@ -311,6 +318,7 @@ private:
|
||||
ObjectInfoMap _creatureInfo;
|
||||
ObjectInfoMap _gameObjectInfo;
|
||||
ObjectGuidMap _objectGuids;
|
||||
ObjectStateMap _objectStateMap;
|
||||
uint32 completedEncounters; // completed encounter mask, bit indexes are DungeonEncounter.dbc boss numbers, used for packets
|
||||
std::unordered_set<uint32> _activatedAreaTriggers;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user