Updated EligibleDamageTarget additional safeguard on owner check.

This commit is contained in:
2024-10-02 23:27:33 -04:00
parent af9e7b3f3f
commit cbde9bbfe2

View File

@@ -1,4 +1,6 @@
#include "MpLogger.h"
#include "MpDataStore.h"
#include "MythicPlus.h"
#include "Player.h"
#include "ScriptMgr.h"
@@ -7,6 +9,27 @@ class MythicPlus_PlayerScript : public PlayerScript
public:
MythicPlus_PlayerScript() : PlayerScript("MythicPlus_PlayerScript") { }
void OnPlayerJustDied(Player* player, Unit* killer)
{
Map* map = player->GetMap();
if(!sMythicPlus->IsMapEligible(map)) {
return;
}
if (!player) {
return;
}
if (!killer) {
return;
}
MpGroupData *data = sMpDataStore->GetGroupData(player->GetGroup());
if (player->GetMap()->IsDungeon()) {
MpLogger::debug("Player {} just died in dungeon {} by {}", player->GetName(), player->GetMap()->GetMapName(), killer->GetName());
}
}
};
void Add_MP_PlayerScripts()