Skip to content

Commit

Permalink
[10589] Always activate GO type 3 when quest id is defined (and active)
Browse files Browse the repository at this point in the history
GO may be "lootless", but events at looting can happen

Signed-off-by: NoFantasy <nofantasy@nf.no>
  • Loading branch information
NoFantasy committed Oct 8, 2010
1 parent 1bb78dc commit 36f91ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/game/GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,10 @@ bool GameObject::ActivateToQuest( Player *pTarget)const
// scan GO chest with loot including quest items
case GAMEOBJECT_TYPE_CHEST:
{
if(LootTemplates_Gameobject.HaveQuestLootForPlayer(GetGOInfo()->GetLootId(), pTarget))
if (pTarget->GetQuestStatus(GetGOInfo()->chest.questId) == QUEST_STATUS_INCOMPLETE)
return true;

if (LootTemplates_Gameobject.HaveQuestLootForPlayer(GetGOInfo()->GetLootId(), pTarget))
{
//look for battlegroundAV for some objects which are only activated after mine gots captured by own team
if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S)
Expand Down
8 changes: 7 additions & 1 deletion src/game/ObjectMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7725,8 +7725,14 @@ void ObjectMgr::LoadGameObjectForQuests()
{
uint32 loot_id = goInfo->GetLootId();

// always activate to quest, GO may not have loot
if (goInfo->chest.questId)
{
mGameObjectForQuestSet.insert(go_entry);
++count;
}
// find quest loot for GO
if(LootTemplates_Gameobject.HaveQuestLootFor(loot_id))
else if (LootTemplates_Gameobject.HaveQuestLootFor(loot_id))
{
mGameObjectForQuestSet.insert(go_entry);
++count;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10588"
#define REVISION_NR "10589"
#endif // __REVISION_NR_H__

1 comment on commit 36f91ea

@kamikazetg
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be better code to use:
if (goInfo->chest.questId || LootTemplates_Gameobject.HaveQuestLootFor(loot_id))

instead of repeating the same insert and count twice? Technically, it's the same thing but I don't see the need for extra lines.

Please sign in to comment.