mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 19:35:42 +00:00
refactor(Core/Object): adds consistency in the use of type object check (#19671)
This commit is contained in:
@@ -124,7 +124,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData)
|
||||
|
||||
// no or incorrect quest giver
|
||||
if (!object || object == _player || (object->GetTypeId() != TYPEID_PLAYER && !object->hasQuest(questId)) ||
|
||||
(object->GetTypeId() == TYPEID_PLAYER && !object->ToPlayer()->CanShareQuest(questId)))
|
||||
(object->IsPlayer() && !object->ToPlayer()->CanShareQuest(questId)))
|
||||
{
|
||||
_player->PlayerTalkClass->SendCloseGossip();
|
||||
_player->SetDivider();
|
||||
@@ -138,7 +138,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData)
|
||||
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
|
||||
{
|
||||
// pussywizard: exploit fix, can't share quests that give items to be sold
|
||||
if (object->GetTypeId() == TYPEID_PLAYER)
|
||||
if (object->IsPlayer())
|
||||
if (uint32 itemId = quest->GetSrcItemId())
|
||||
if (ItemTemplate const* srcItem = sObjectMgr->GetItemTemplate(itemId))
|
||||
if (srcItem->SellPrice > 0)
|
||||
@@ -220,7 +220,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket& recvData)
|
||||
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
|
||||
{
|
||||
// not sure here what should happen to quests with QUEST_FLAGS_AUTOCOMPLETE
|
||||
// if this breaks them, add && object->GetTypeId() == TYPEID_ITEM to this check
|
||||
// if this breaks them, add && object->IsItem() to this check
|
||||
// item-started quests never have that flag
|
||||
if (!_player->CanTakeQuest(quest, true))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user