mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 10:55:43 +00:00
fix(DB/Conditions): Grub should sell its items only to players who co… (#13803)
...mpleted "Dig Rat Stew" quest.
This commit is contained in:
@@ -1761,28 +1761,33 @@ void Player::UpdateForQuestWorldObjects()
|
||||
continue;
|
||||
|
||||
// check if this unit requires quest specific flags
|
||||
if (!obj->HasNpcFlag(UNIT_NPC_FLAG_SPELLCLICK))
|
||||
continue;
|
||||
|
||||
SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(obj->GetEntry());
|
||||
for (SpellClickInfoContainer::const_iterator _itr = clickPair.first; _itr != clickPair.second; ++_itr)
|
||||
if (obj->HasNpcFlag(UNIT_NPC_FLAG_SPELLCLICK))
|
||||
{
|
||||
//! This code doesn't look right, but it was logically converted to condition system to do the exact
|
||||
//! same thing it did before. It definitely needs to be overlooked for intended functionality.
|
||||
ConditionList conds = sConditionMgr->GetConditionsForSpellClickEvent(obj->GetEntry(), _itr->second.spellId);
|
||||
bool buildUpdateBlock = false;
|
||||
for (ConditionList::const_iterator jtr = conds.begin(); jtr != conds.end() && !buildUpdateBlock; ++jtr)
|
||||
if ((*jtr)->ConditionType == CONDITION_QUESTREWARDED || (*jtr)->ConditionType == CONDITION_QUESTTAKEN)
|
||||
buildUpdateBlock = true;
|
||||
|
||||
if (buildUpdateBlock)
|
||||
SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(obj->GetEntry());
|
||||
for (SpellClickInfoContainer::const_iterator _itr = clickPair.first; _itr != clickPair.second; ++_itr)
|
||||
{
|
||||
obj->BuildValuesUpdateBlockForPlayer(&udata, this);
|
||||
break;
|
||||
//! This code doesn't look right, but it was logically converted to condition system to do the exact
|
||||
//! same thing it did before. It definitely needs to be overlooked for intended functionality.
|
||||
ConditionList conds = sConditionMgr->GetConditionsForSpellClickEvent(obj->GetEntry(), _itr->second.spellId);
|
||||
bool buildUpdateBlock = false;
|
||||
for (ConditionList::const_iterator jtr = conds.begin(); jtr != conds.end() && !buildUpdateBlock; ++jtr)
|
||||
if ((*jtr)->ConditionType == CONDITION_QUESTREWARDED || (*jtr)->ConditionType == CONDITION_QUESTTAKEN)
|
||||
buildUpdateBlock = true;
|
||||
|
||||
if (buildUpdateBlock)
|
||||
{
|
||||
obj->BuildValuesUpdateBlockForPlayer(&udata, this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (obj->HasNpcFlag(UNIT_NPC_FLAG_VENDOR_MASK | UNIT_NPC_FLAG_TRAINER))
|
||||
{
|
||||
obj->BuildValuesUpdateBlockForPlayer(&udata, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
udata.BuildPacket(&packet);
|
||||
GetSession()->SendPacket(&packet);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user