Core/Quests: Fixed a crash caused when trying to add a quest to a player who does not have any free slot in his quest log. fixes #4572
Signed-off-by: Subv2112 <[email protected]>
This commit is contained in:
@@ -14824,7 +14824,9 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
|
|||||||
void Player::AddQuest(Quest const* quest, Object* questGiver)
|
void Player::AddQuest(Quest const* quest, Object* questGiver)
|
||||||
{
|
{
|
||||||
uint16 log_slot = FindQuestSlot(0);
|
uint16 log_slot = FindQuestSlot(0);
|
||||||
ASSERT(log_slot < MAX_QUEST_LOG_SIZE);
|
|
||||||
|
if (log_slot >= MAX_QUEST_LOG_SIZE) // Player does not have any free slot in the quest log
|
||||||
|
return;
|
||||||
|
|
||||||
uint32 quest_id = quest->GetQuestId();
|
uint32 quest_id = quest->GetQuestId();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user