Core/SmartAI: allow SMART_ACTION_SEND_GOSSIP_MENU to override default gossip
This commit is contained in:
1 parent
208533840d
commit
1f95d87e92
3 files changed
+28
-7
No files matched your search
@@ -2215,7 +2215,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",
|
||||
@@ -2225,6 +2225,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