Core/Gossip: Fixed remaining issues with gossip menu items

This commit is contained in:
Shauren
2011-05-27 14:22:36 +02:00
parent bc2cca0733
commit 889cdda614
2 changed files with 6 additions and 9 deletions
@@ -180,7 +180,7 @@ class GossipMenu
return _menuItems.empty(); return _menuItems.empty();
} }
GossipMenuItem const* GetItem(unsigned int id) const GossipMenuItem const* GetItem(uint32 id) const
{ {
GossipMenuItemContainer::const_iterator itr = _menuItems.find(id); GossipMenuItemContainer::const_iterator itr = _menuItems.find(id);
if (itr != _menuItems.end()) if (itr != _menuItems.end())
@@ -189,7 +189,7 @@ class GossipMenu
return NULL; return NULL;
} }
GossipMenuItemData const* GetItemData(unsigned int indexId) const GossipMenuItemData const* GetItemData(uint32 indexId) const
{ {
GossipMenuItemDataContainer::const_iterator itr = _menuItemData.find(indexId); GossipMenuItemDataContainer::const_iterator itr = _menuItemData.find(indexId);
if (itr != _menuItemData.end()) if (itr != _menuItemData.end())
+4 -7
View File
@@ -14115,16 +14115,13 @@ void Player::SendPreparedGossip(WorldObject* source)
void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 menuId) void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 menuId)
{ {
GossipMenu& gossipmenu = PlayerTalkClass->GetGossipMenu(); GossipMenu& gossipMenu = PlayerTalkClass->GetGossipMenu();
if (gossipListId >= gossipmenu.GetMenuItemCount())
return;
// if not same, then something funky is going on // if not same, then something funky is going on
if (menuId != gossipmenu.GetMenuId()) if (menuId != gossipMenu.GetMenuId())
return; return;
GossipMenuItem const* item = gossipmenu.GetItem(gossipListId); GossipMenuItem const* item = gossipMenu.GetItem(gossipListId);
if (!item) if (!item)
return; return;
@@ -14140,7 +14137,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
} }
} }
GossipMenuItemData const* menuItemData = gossipmenu.GetItemData(gossipListId); GossipMenuItemData const* menuItemData = gossipMenu.GetItemData(gossipListId);
if (!menuItemData) if (!menuItemData)
return; return;