more work
This commit is contained in:
@@ -50,10 +50,6 @@ PerkProgramManager::~PerkProgramManager()
|
||||
|
||||
void PerkProgramManager::SendVendorItems(Creature* vendor, std::vector<uint32> purchasedItems)
|
||||
{
|
||||
// Additional safety check - verify this pointer is valid
|
||||
if (this == nullptr)
|
||||
return;
|
||||
|
||||
if (!_session || !vendor)
|
||||
return;
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "PetBattleMgr.h"
|
||||
#include "HousingNeighborhoodMirrorEntity.h"
|
||||
#include "HousingPlayerHouseEntity.h"
|
||||
#include "PerkProgramMgr.h"
|
||||
//WowCommunity
|
||||
namespace {
|
||||
|
||||
@@ -158,7 +159,8 @@ WorldSession::WorldSession(uint32 id, std::string&& name, uint32 battlenetAccoun
|
||||
_timeSyncTimer(0),
|
||||
_calendarEventCreationCooldown(0),
|
||||
_battlePetMgr(std::make_unique<BattlePets::BattlePetMgr>(this)),
|
||||
_collectionMgr(std::make_unique<CollectionMgr>(this))
|
||||
_collectionMgr(std::make_unique<CollectionMgr>(this)),
|
||||
_perkProgramMgr(std::make_shared<PerkProgramManager>(this))
|
||||
#ifdef BUILD_PLAYERBOT
|
||||
, _isBot(is_bot)
|
||||
#endif
|
||||
|
||||
@@ -2535,7 +2535,11 @@ class TC_GAME_API WorldSession
|
||||
private:
|
||||
std::shared_ptr<PerkProgramManager> _perkProgramMgr;
|
||||
public:
|
||||
PerkProgramManager* GetPerkProgramMgr() const { return _perkProgramMgr.get(); }
|
||||
PerkProgramManager* GetPerkProgramMgr() const {
|
||||
if (!_perkProgramMgr)
|
||||
_perkProgramMgr = std::make_shared<PerkProgramManager>(const_cast<WorldSession*>(this));
|
||||
return _perkProgramMgr.get();
|
||||
}
|
||||
//WowCommunity
|
||||
|
||||
WorldSession(WorldSession const& right) = delete;
|
||||
|
||||
Reference in New Issue
Block a user