Turned on player scripts have segfault in bind to instance that needs fixed.

This commit is contained in:
2024-11-21 23:52:02 -05:00
parent fbcb218dd6
commit 73018100ac
3 changed files with 6 additions and 10 deletions

View File

@@ -84,14 +84,6 @@ void MpDataStore::AddGroupData(Group *group, MpGroupData groupData) {
_groupData->emplace(guid, groupData);
}
MpLogger::debug("Add Group difficulty for group {} to {}", guid.GetCounter());
CharacterDatabase.Execute("REPLACE INTO group_difficulty (guid, difficulty) VALUES ({},{}) ",
guid.GetCounter(),
groupData.difficulty
);
const Group::MemberSlotList members = group->GetMemberSlots();
for (const auto &memberSlot : members) {
Player* player = ObjectAccessor::FindPlayer(memberSlot.guid);

View File

@@ -25,7 +25,7 @@ void Addmod_mythic_plusScripts()
Add_MP_CommandScripts();
Add_MP_GlobalScripts();
// Add_MP_GroupScripts();
// Add_MP_PlayerScripts();
Add_MP_PlayerScripts();
Add_MP_UnitScripts();
Add_MP_WorldScripts();

View File

@@ -9,8 +9,10 @@ class MythicPlus_PlayerScript : public PlayerScript
public:
MythicPlus_PlayerScript() : PlayerScript("MythicPlus_PlayerScript") { }
void OnPlayerJustDied(Player* player, Unit* killer)
void OnPlayerKilledByCreature(Player* player, Unit* killer)
{
MpLogger::debug("OnPlayerJustDied: %s", player->GetName());
Map* map = player->GetMap();
if(!sMythicPlus->IsMapEligible(map)) {
return;
@@ -22,11 +24,13 @@ public:
MpGroupData *data = sMpDataStore->GetGroupData(player->GetGroup());
if (!data) {
MpLogger::error("OnPlayerJustDied: No group data found for %s", player->GetName());
return;
}
MpPlayerData *playerData = sMpDataStore->GetPlayerData(player->GetGUID());
if (!playerData) {
MpLogger::error("OnPlayerJustDied: No player data found for %s", player->GetName());
return;
}