Core/Units: Fixed crash happening whenall tappers of a creature are logged out when it dies inside a dungeon
Port From (https://github.com/TrinityCore/TrinityCore/commit/6cac60782f0bc67c0f4b70b41cac36357fbd2531)
This commit is contained in:
@@ -105,14 +105,17 @@ namespace Game.Entities
|
||||
instance.UpdateEncounterStateForKilledCreature(_victim.GetEntry(), _victim);
|
||||
}
|
||||
|
||||
uint guildId = victim.GetMap().GetOwnerGuildId();
|
||||
var guild = Global.GuildMgr.GetGuildById(guildId);
|
||||
if (guild != null)
|
||||
guild.UpdateCriteria(CriteriaType.KillCreature, victim.GetEntry(), 1, 0, victim, _killers.First());
|
||||
if (!_killers.Empty())
|
||||
{
|
||||
uint guildId = victim.GetMap().GetOwnerGuildId();
|
||||
var guild = Global.GuildMgr.GetGuildById(guildId);
|
||||
if (guild != null)
|
||||
guild.UpdateCriteria(CriteriaType.KillCreature, victim.GetEntry(), 1, 0, victim, _killers.First());
|
||||
|
||||
Scenario scenario = victim.GetScenario();
|
||||
if (scenario != null)
|
||||
scenario.UpdateCriteria(CriteriaType.KillCreature, victim.GetEntry(), 1, 0, victim, _killers.First());
|
||||
Scenario scenario = victim.GetScenario();
|
||||
if (scenario != null)
|
||||
scenario.UpdateCriteria(CriteriaType.KillCreature, victim.GetEntry(), 1, 0, victim, _killers.First());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -765,17 +765,17 @@ namespace Game.Entities
|
||||
|
||||
if (creature.GetMap().IsDungeon())
|
||||
{
|
||||
Group group = !groups.Empty() ? groups.First() : null;
|
||||
Player looter = group ? Global.ObjAccessor.GetPlayer(creature, group.GetLooterGuid()) : tappers[0];
|
||||
|
||||
if (dungeonEncounter != null)
|
||||
{
|
||||
creature.m_personalLoot = LootManager.GenerateDungeonEncounterPersonalLoot(dungeonEncounter.Id, creature.GetCreatureTemplate().LootId,
|
||||
LootStorage.Creature, LootType.Corpse, creature, creature.GetCreatureTemplate().MinGold, creature.GetCreatureTemplate().MaxGold,
|
||||
(ushort)creature.GetLootMode(), creature.GetMap().GetDifficultyLootItemContext(), tappers);
|
||||
}
|
||||
else
|
||||
else if (!tappers.Empty())
|
||||
{
|
||||
Group group = !groups.Empty() ? groups.First() : null;
|
||||
Player looter = group ? Global.ObjAccessor.GetPlayer(creature, group.GetLooterGuid()) : tappers[0];
|
||||
|
||||
Loot loot = new(creature.GetMap(), creature.GetGUID(), LootType.Corpse, dungeonEncounter != null ? group : null);
|
||||
|
||||
uint lootid = creature.GetCreatureTemplate().LootId;
|
||||
|
||||
Reference in New Issue
Block a user