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:
Hondacrx
2024-08-26 17:41:44 -04:00
parent 511ac17c55
commit b7b166c0f0
3 changed files with 37 additions and 12 deletions
@@ -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;
}