mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Quests: Fixed crash happening when a player is quest ender
Closes #257625
This commit is contained in:
@@ -388,7 +388,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPackets::Quest::Quest
|
||||
case TYPEID_PLAYER:
|
||||
{
|
||||
//For AutoSubmition was added plr case there as it almost same exclute AI script cases.
|
||||
Creature* creatureQGiver = object->ToCreature();
|
||||
Unit* unitQGiver = object->ToUnit();
|
||||
// Send next quest
|
||||
if (Quest const* nextQuest = _player->GetNextQuest(packet.QuestGiverGUID, quest))
|
||||
{
|
||||
@@ -403,7 +403,8 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPackets::Quest::Quest
|
||||
}
|
||||
|
||||
_player->PlayerTalkClass->ClearMenus();
|
||||
creatureQGiver->GetAI()->QuestReward(_player, quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID);
|
||||
if (UnitAI* qGiverAI = unitQGiver->GetAI())
|
||||
qGiverAI->QuestReward(_player, quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID);
|
||||
break;
|
||||
}
|
||||
case TYPEID_GAMEOBJECT:
|
||||
|
||||
Reference in New Issue
Block a user