Core/SmartAI: fixed Gossip Select event

--HG--
branch : trunk
This commit is contained in:
Rat
2010-11-03 19:39:53 +01:00
parent c9cf2f059f
commit 2604250c3c
3 changed files with 11 additions and 12 deletions
@@ -139,30 +139,28 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
{
if (unit)
{
unit->AI()->sGossipSelectCode(_player,gossipListId, menuId, code.c_str());
if (!sScriptMgr.OnGossipSelectCode(_player, unit, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str()))
_player->OnGossipSelect(unit, gossipListId, menuId);
unit->AI()->sGossipSelectCode(_player, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str());
}
else
{
{
go->AI()->GossipSelectCode(_player, gossipListId, menuId, code.c_str());
sScriptMgr.OnGossipSelectCode(_player, go, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str());
go->AI()->GossipSelectCode(_player, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str());
}
}
else
{
if (unit)
{
unit->AI()->sGossipSelect(_player, gossipListId, menuId);
if (!sScriptMgr.OnGossipSelect(_player, unit, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId)))
_player->OnGossipSelect(unit, gossipListId, menuId);
unit->AI()->sGossipSelect(_player, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId));
}
else
{
go->AI()->GossipSelect(_player, gossipListId, menuId);
sScriptMgr.OnGossipSelect(_player, go, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId));
go->AI()->GossipSelect(_player, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId));
}
}
}