mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 20:22:23 -04:00
Core/SmartAI: allow SMART_ACTION_SEND_GOSSIP_MENU to override default gossip
Closes #19769
(cherry picked from commit f2b0819e53)
This commit is contained in:
@@ -2411,7 +2411,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
}
|
||||
case SMART_ACTION_SEND_GOSSIP_MENU:
|
||||
{
|
||||
if (!GetBaseObject())
|
||||
if (!GetBaseObject() || !IsSmart())
|
||||
break;
|
||||
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId %d, gossipNpcTextId %d",
|
||||
@@ -2421,6 +2421,12 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!targets)
|
||||
break;
|
||||
|
||||
// override default gossip
|
||||
if (me)
|
||||
ENSURE_AI(SmartAI, me->AI())->SetGossipReturn(true);
|
||||
else if (go)
|
||||
ENSURE_AI(SmartGameObjectAI, go->AI())->SetGossipReturn(true);
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
if (Player* player = (*itr)->ToPlayer())
|
||||
|
||||
Reference in New Issue
Block a user