more work

This commit is contained in:
luis
2026-03-15 21:20:35 -03:00
parent dfe864e477
commit 27b107530d
3 changed files with 8 additions and 6 deletions
@@ -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;
+3 -1
View File
@@ -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
+5 -1
View File
@@ -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;