Core/Quests: Fixed crash happening when a player is quest ender
Port From (https://github.com/TrinityCore/TrinityCore/commit/1000f670d211f2ac5aef3351af0f08de06e13097)
This commit is contained in:
@@ -360,7 +360,7 @@ namespace Game
|
||||
case TypeId.Player:
|
||||
{
|
||||
//For AutoSubmition was added plr case there as it almost same exclute AI script cases.
|
||||
Creature creatureQGiver = obj.ToCreature();
|
||||
Unit unitQGiver = obj.ToUnit();
|
||||
// Send next quest
|
||||
Quest nextQuest = _player.GetNextQuest(packet.QuestGiverGUID, quest);
|
||||
if (nextQuest != null)
|
||||
@@ -376,7 +376,9 @@ namespace Game
|
||||
}
|
||||
|
||||
_player.PlayerTalkClass.ClearMenus();
|
||||
creatureQGiver.GetAI().QuestReward(_player, quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID);
|
||||
var qGiverAI = unitQGiver.GetAI();
|
||||
if (qGiverAI != null)
|
||||
qGiverAI.QuestReward(_player, quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID);
|
||||
break;
|
||||
}
|
||||
case TypeId.GameObject:
|
||||
|
||||
Reference in New Issue
Block a user