mirror of
https://github.com/araxiaonline/mod-mythic-plus.git
synced 2026-06-13 11:12:23 -04:00
Changed MythicPlus and MpDataStore to pure singletons and updated current
calling scripts to not get the instance just call via defined macro
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "Log.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MpLogger.h"
|
||||
#include "MpDataStore.h"
|
||||
#include "MythicPlus.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
@@ -15,10 +16,9 @@ public:
|
||||
|
||||
void OnCreateMap(Map* map)
|
||||
{
|
||||
static MythicPlus* mp = MythicPlus::getInstance();
|
||||
MpLogger::debug("AllMapScript::OnCreateMap(): {}", map->GetMapName());
|
||||
|
||||
if (!mp->IsMapEligible(map)) {
|
||||
if (!sMythicPlus->IsMapEligible(map)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -27,10 +27,9 @@ public:
|
||||
|
||||
void OnPlayerEnterAll(Map* map, Player* player)
|
||||
{
|
||||
static MythicPlus* mp = MythicPlus::getInstance();
|
||||
MpLogger::debug("AllMapScript::OnPlayerEnterAll(): {}", map->GetMapName());
|
||||
|
||||
if (!mp->IsMapEligible(map)) {
|
||||
if (!sMythicPlus->IsMapEligible(map)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,10 +37,9 @@ public:
|
||||
|
||||
void OnPlayerLeaveAll(Map* map, Player* player)
|
||||
{
|
||||
static MythicPlus* mp = MythicPlus::getInstance();
|
||||
MpLogger::debug("AllMapScript::OnPlayerLeaveAll(): {}", map->GetMapName());
|
||||
|
||||
if (!mp->IsMapEligible(map)) {
|
||||
if (!sMythicPlus->IsMapEligible(map)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -53,4 +51,4 @@ void Add_MP_AllMapScripts()
|
||||
{
|
||||
MpLogger::debug("Add_MP_AllMapScripts()");
|
||||
new MythicPlus_AllMapScript();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user