Core/GameObjects: Fixed the interaction/highlight logic for GAMEOBJECT_TYPE_CHEST and quest objectives
Port From (https://github.com/TrinityCore/TrinityCore/commit/31bd3804e35f63915a5d6d669b31add6c82d7010)
This commit is contained in:
@@ -1367,6 +1367,20 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasConditionalInteraction()
|
||||
{
|
||||
if (GetGoInfo().GetQuestID() != 0)
|
||||
return true;
|
||||
|
||||
if (GetGoType() != GameObjectTypes.AuraGenerator && GetGoInfo().GetConditionID1() != 0)
|
||||
return true;
|
||||
|
||||
if (Global.ObjectMgr.IsGameObjectForQuests(GetEntry()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CanActivateForPlayer(Player target)
|
||||
{
|
||||
if (!MeetsInteractCondition(target))
|
||||
@@ -1427,6 +1441,12 @@ namespace Game.Entities
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
case GameObjectTypes.GatheringNode:
|
||||
{
|
||||
if (LootStorage.Gameobject.HaveQuestLootForPlayer(GetGoInfo().GatheringNode.chestLoot, target))
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user